Configuring Wallet Manager to enable HTTPS connect
Recently , one of request has been raised in our organization. That is HTTPS site access through oracle PL/SQL package by using UTL_HTTP. Our developers got success in accessing un-secured HTTP site, but failed in accessing Secured Socket Layer protocol (SSL) HTTPS site.
As per Oracle® Database PL/SQL Packages and Types Reference 10g Release 2 (10.2) , “An Oracle wallet must be set before accessing Web servers over HTTPS by using SET_WALLET procedure”. The general syntax of SET_WALLET is listed below.
UTL_HTTP.SET_WALLET (
path IN VARCHAR2,
password IN VARCHAR2 DEFAULT NULL);
Here, parameter “path” is the directory path that contains the Oracle Wallet. And, parameter “password” is the password needed to open wallet.
Before using SET_WALLET procedure, a new wallet need to be created, if there is not, and the HTTPS site certificate need to imported. To complete that, we follow the steps below.
Step 1: Obtaining the correct certificate from the HTTPS site that we are connecting to
a) Access target https URL in browser
b) Select “Properties” from menu
c) Click button “Certificates” in “Properties” window, and highlight the top most certificate in tab of “Certification Path”, and then click button “View Certificate”, and eventually click button “Copy to File…” in tab of “Details”
d) Copy certificate file over network to oracle server
Note: Be sure to highlight “the top most” certificate. Otherwise, you’ll experience failure.
Step 2: Creating wallet on oracle server side because we don’t have
a) Start the wallet manager on oracle server with command “owm”
b) Create new wallet if there is not
c) Save this new wallet to the location you want
Step 3: Importing certificate we got in step 1
Within oracle wallet manager, go to the “operations” tab and click on ‘Import Trusted Certificate’, choose the option to select newly-created certificate file that was created in step 1. After that, save wallet again.
Step 4: Testing the access from SQL*PLUS
a) Start a SQL*PLUS session as any user that has access to the UTL_HTTP package
b) Issue the following command to test.
SQL> select utl_http.request(’https://secure.aizan.biz/Web/Common/XmlAutomation/Upload.aspx’, null, ‘file:/etc/ORACLE/WALLETS/oracle’,'doug1las’) from dual;
OUTPUT:
UTL_HTTP.REQUEST(’HTTPS://SECURE.AIZAN.BIZ/WEB/COMMON/XMLAUTOMATION/UPLOAD.ASPX’
——————————————————————————–
<?xml version="1.0" encoding="utf-8" ?>
<Aizan_XMLAutomation_Response>
<Error>
<Body>
Empty or wrong request XML
</Body>
</Error>
</Aizan_XMLAutomation_Response>
Done!
Popularity: 2% [?]
Tags:none















