5 Replies Latest reply: Sep 10, 2012 2:44 AM by 960445 RSS

    Config XDB for https ssl access

    960445
      Hello,
      I’m trying to configure an Oracle DB 11g for https access. I tried to set the port to 8089 and the protocol to tcps.
      When I execute the following lines of code, I always get an Error, that the xml-file is not ok. But when validate the output of my modification on the XML, it says that it is OK.
      Screenshot of the Error-Massage: https://dl.dropbox.com/u/13247554/fb_comments/ORA-ERROR.JPG


      DECLARE

      configxml SYS.XMLType;
      configxml2 SYS.XMLType;

      begin
      SELECT insertXMLBefore((insertXMLBefore(DBMS_XDB.cfg_get(),
      '/xdbconfig/sysconfig/protocolconfig/httpconfig/authentication',
      XMLType('<http2-protocol xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">tcps</http2-protocol>'))),
      '/xdbconfig/sysconfig/protocolconfig/httpconfig/authentication',
      XMLType('<http2-port xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">8080</http2-port>'))
      into configxml2
      from dual;

      -- Update the configuration to use the modified version
      DBMS_XDB.cfg_update(configxml2);

      END;

      Does anybody has the same problem and can help me?_
        • 1. Re: Config XDB for https ssl access
          Marco Gralike
          Configuration steps/guidelines

          http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb22pro.htm#CHDCAHDH

          Updating xdbconfig.xml

          http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb22pro.htm#CHDCAHDH
          This example illustrates the use of procedure cfg_update. The current configuration is retrieved as an XMLType instance and modified. It is then rewritten using cfg_update.
          
          DECLARE
            configxml    SYS.XMLType;
            configxml2   SYS.XMLType;
          BEGIN
            -- Get the current configuration
            configxml := DBMS_XDB.cfg_get();
           
            -- Modify the configuration
            SELECT updateXML(
                     configxml,
                     '/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()',
                     '8000',
                     'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"')
              INTO configxml2 FROM DUAL;
           
            -- Update the configuration to use the modified version
            DBMS_XDB.cfg_update(configxml2);
          END;
          /
           
          PL/SQL procedure successfully completed.
          
          SELECT DBMS_XDB.cfg_get() FROM DUAL;
           
          DBMS_XDB.CFG_GET()
          --------------------------------------------------------------------------------
          <xdbconfig xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd" xmlns:xsi="http://w
          ww.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/x
          db/xdbconfig.xsd                                     http://xmlns.oracle.com/xdb
          /xdbconfig.xsd">
            <sysconfig>
              <acl-max-age>900</acl-max-age>
              <acl-cache-size>32</acl-cache-size>
              <invalid-pathname-chars>,</invalid-pathname-chars>
              <case-sensitive>true</case-sensitive>
              <call-timeout>300</call-timeout>
              <max-link-queue>65536</max-link-queue>
              <max-session-use>100</max-session-use>
              <persistent-sessions>false</persistent-sessions>
              <default-lock-timeout>3600</default-lock-timeout>
              <xdbcore-logfile-path/>
              <xdbcore-log-level>0</xdbcore-log-level>
              <resource-view-cache-size>1048576</resource-view-cache-size>
              <protocolconfig>
                <common>
                . . .
                </common>
                <ftpconfig>
                . . .
                </ftpconfig>
                <httpconfig>
                  <http-port>8000</http-port>
                  . . .
                </httpconfig>
              </protocolconfig>
              <xdbcore-xobmem-bound>1024</xdbcore-xobmem-bound>
              <xdbcore-loadableunit-size>16</xdbcore-loadableunit-size>
            </sysconfig>
          </xdbconfig>
           
          1 row selected.
          Edited by: Marco Gralike on Sep 6, 2012 10:59 PM
          • 2. Re: Config XDB for https ssl access
            960445
            The problem is, that the tag "http2-port" and "http2-protocol" are not yet in the file. So I need to add those tags to the XML file. It always fails, when i try it like this. I need a method to add those Tags.



            Or is it not necessary to use *"http2-.."* ? Can I use instead *"http-port -/protocol"* to access the database via https?

            Edited by: 957442 on 07.09.2012 10:06
            • 3. Re: Config XDB for https ssl access
              960445
              When I do it like it is shown in the following script (modifying the http2-.. tags) , it doesn' t change anything in the xdbconfig.xml file...


              DECLARE
              configxml SYS.XMLType;
              configxml2 SYS.XMLType;
              BEGIN
              -- Get the current configuration
              configxml := DBMS_XDB.cfg_get();

              -- Modify the configuration
              SELECT updateXML(
              configxml,
              '/xdbconfig/sysconfig/protocolconfig/httpconfig/http2-port/text()',
              '8082',
              'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"')
              INTO configxml2 FROM DUAL;

              SELECT updateXML(
              configxml2,
              '/xdbconfig/sysconfig/protocolconfig/httpconfig/http2-protocol/text()',
              'TCPS',
              'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"')
              INTO configxml2 FROM DUAL;

              -- Update the configuration to use the modified version
              DBMS_XDB.cfg_update(configxml2);
              END;
              • 4. Re: Config XDB for https ssl access
                Marco Gralike
                Just to be sure (please confirm); You need the XDBADMIN role to be able to do this...
                • 5. Re: Config XDB for https ssl access
                  960445
                  I found something to insert those XML-tags:
                  DECLARE
                  l_configxml XMLTYPE;
                  BEGIN
                  l_configxml := DBMS_XDB.cfg_get();

                  -- Add missing element.
                  SELECT insertChildXML(l_configxml,
                  '/xdbconfig/sysconfig/protocolconfig/httpconfig',
                  'http2-port',
                  XMLType('<http2-port xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">8082</http2-port>'),
                  'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"')
                  INTO l_configxml
                  FROM dual;

                  SELECT insertChildXML(l_configxml,
                  '/xdbconfig/sysconfig/protocolconfig/httpconfig',
                  'http2-protocol',
                  XMLType('<http2-protocol xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">TCPS</http2-protocol>'),
                  'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"')
                  INTO l_configxml
                  FROM dual;

                  DBMS_XDB.cfg_update(l_configxml);
                  DBMS_XDB.cfg_refresh;
                  END;