Monday, June 22, 2015

Weblogic JDBC ORCL connection over SSL

If you want to create a jdbc data source in weblogic or convert an existing jdbc data source in weblogic to connect to an oracle database over SSL then follow these simple steps

Step 1 : get the Oracle DB certificate chain in a .pem format

Step 2 : create a JKS wallet

  • source the setDomainEnv.sh or setDomainEnv.cmd in a command window depending on the OS you are on its located at WL_HOME\user_projects\domains\DOMAIN_NAME\bin
  • cd to FMW_HOME/Oracle_BI1/jdk/bin
  •  import cert using command
    •  ./keytool -import -keystore /path/mystore.jks -file /path/cert.pem -alias cert_chain  
    • provide a pwd when prompted
Step 3 :Edit the URL of  jdbc connection pool in weblogic to look like this

Current
jdbc:oracle:thin:@SERVER:1300/service_name

to

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=server)(PORT=1310))(CONNECT_DATA=(SERVICE_NAME=service_name)))

Step 4 : in the properties box where you already have the statement user=some_user add the following lines

javax.net.ssl.trustStoreType=JKS
javax.net.ssl.trustStore=/path/mystore.jks
javax.net.ssl.trustStorePassword=myPassword

save and test ...:-) all done

WL Version used : 10.3.6


No comments:

Post a Comment