Friday, 29 March 2019

Oracle wallet for connecting to a SSL(HTTPS) enabled application by SQL/PL-SQL query


If we want to connect to an application having SSL configuration (running over https) then it will throw error of certificate.

To solve this issue we need to create a wallet in DB and use that wallet in code.

Steps to create wallet:

1)   orapki wallet create -wallet ${ORACLE_HOME}/<wallet_name> -pwd <password>
      For e.g. orapki wallet create -wallet ${ORACLE_HOME}/https_wallet -pwd ****

2)    orapki wallet add -wallet https_wallet -cert <certificate.cer> -trusted_cert -pwd ******

     After adding certificate you can verify the certificate is present in wallet. You are done with server side changes of wallet.

In client side code you need to set the wallet before connecting to application.

     utl_http.set_wallet( 'file:/oravl01/oracle/12.1.0.1/owm/https_wallet' , '****' );

  After this you can connect to the application

req  := utl_http.begin_request( 'https://<user>:<pass>@<host>:<port>/test' );
resp := utl_http.get_response(req);

No comments:

Post a Comment

Thank You for your valuable comment

Difference between class level and object locking and static object lock

1) Class level locking will lock entire class, so no other thread can access any of other synchronized blocks. 2) Object locking will lo...