2

I have a server with a fresh installation of WebSphere Application Server 8.5.5 and I'm trying to configure a data source over a connection using JDBC and Oracle Wallet for SSL.

The error message in WebSphere is "Unable to verify MAC". I've confirmed that the password I configured the data source to use is the correct password for the Oracle Wallet keystore, ewallet.p12, so I think there's another problem.

My starting point for figuring this out is https://www.ibm.com/developerworks/community/blogs/aimsupport/entry/websphere_application_server_and_oracle_ssl_oracle_wallet?lang=en . That's where I came up with the following configuration settings I'm using. I also tried the instructions at http://bpm4everyone.blogspot.co.uk/2013/02/oracle-ssl-with-was.html but couldn't get that to work either and backed it out. I'm new to WebSphere and Oracle Wallet so was unable to determine if the latter was deprecated or not.

I'm configuring the data source on a deployment manager for another node in the cell. The scope of the data source is the other node, the one with the application that will use the data source. The class path of the JDBC provider includes ojdbc6.jar and oraclepki.jar.

The data source is configured to use com.ibm.websphere.rsadapter.Oracle11gDataStoreHelper as the "Data store helper class name". I set up a J2C authentication alias and that is being used by "Component-managed authentication alias". The URL of the data source is jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=10.240.227.131)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=devdb))(SECURITY=(SSL_SERVER_CERT_DN='cn=devdbuser')))). As instructed, I created a custom property for the data source, called "connectionProperties", with a value of oracle.net.ssl_version=3.0;javax.net.ssl.trustStore=/opt/oracle/wallet/client.wallet/ewallet.p12;javax.net.ssl.trustStoreType=PKCS12;java.net.ssl.trustStorePassword=password.

In the deployment manager console, when I click "Test connection" for the data source, I get . . .

The test connection operation failed for data source vammisdevwas01-vadev on server nodeagent at node vammisdevwas01Node01 with the following exception: java.sql.SQLException: IO Error: The Network Adapter could not establish the connection DSRA0010E: SQL State = 08006, Error Code = 17,002. View JVM logs for further details.

When I look at the JVM logs I see . . .

[11/2/15 10:01:05:981 GMT-05:00] 0000007e DataSourceCon E   DSRA8040I: Failed to connect to the DataSource.  Encountered "": java.sql.SQLException: IO Error: The Network Adapter could not establish the connection DSRA0010E: SQL State = 08006, Error Code = 17,002
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:743)
    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:662)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:560)
    at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:311)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:235)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:164)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:102)
    at com.ibm.ws.rsadapter.DSConfigHelper$1.run(DSConfigHelper.java:1266)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5384)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5600)
    at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
    at com.ibm.ws.rsadapter.spi.ServerFunction$6.run(ServerFunction.java:567)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    at com.ibm.ws.rsadapter.DSConfigHelper.getPooledConnection(DSConfigHelper.java:1281)
    at com.ibm.ws.rsadapter.DSConfigHelper.getPooledConnection(DSConfigHelper.java:1189)
    at com.ibm.ws.rsadapter.DSConfigurationHelper.getConnectionFromDSOrPooledDS(DSConfigurationHelper.java:2071)
    at com.ibm.ws.rsadapter.DSConfigurationHelper.getConnectionFromDSOrPooledDS(DSConfigurationHelper.java:1947)
    at com.ibm.ws.rsadapter.DSConfigurationHelper.testConnectionForGUI(DSConfigurationHelper.java:2814)
    at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at com.ibm.ws.management.DataSourceConfigHelperMBean.testConnectionToDataSource2(DataSourceConfigHelperMBean.java:556)
    at com.ibm.ws.management.DataSourceConfigHelperMBean.testConnection(DataSourceConfigHelperMBean.java:484)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:69)
    at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:272)
    at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1152)
    at java.security.AccessController.doPrivileged(AccessController.java:298)
    at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)
    at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1146)
    at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:999)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:847)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:783)
    at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
    at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
    at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java:488)
    at com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:324)
    at com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java:65)
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:733)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:522)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1864)
Caused by: java.lang.Exception: The Network Adapter could not establish the connection
    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:470)
    at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:506)
    at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:595)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:230)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1452)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:496)
    ... 53 more
Caused by: java.lang.Exception: Unable to initialize ssl context.
    at oracle.net.nt.CustomSSLSocketFactory.getSSLSocketFactory(CustomSSLSocketFactory.java:325)
    at oracle.net.nt.TcpsNTAdapter.connect(TcpsNTAdapter.java:117)
    at oracle.net.nt.ConnOption.connect(ConnOption.java:159)
    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:428)
    ... 58 more
Caused by: java.lang.Exception: Unable to initialize the trust store.
    at oracle.net.nt.CustomSSLSocketFactory.getTrustManagerArray(CustomSSLSocketFactory.java:413)
    at oracle.net.nt.CustomSSLSocketFactory.getSSLSocketFactory(CustomSSLSocketFactory.java:309)
    ... 61 more
Caused by: java.io.IOException: Unable to verify MAC.
    at com.ibm.crypto.provider.PKCS12KeyStore.engineLoad(Unknown Source)
    at java.security.KeyStore.load(KeyStore.java:415)
    at oracle.net.nt.CustomSSLSocketFactory.getTrustManagerArray(CustomSSLSocketFactory.java:404)
    ... 62 more

Update

I started over and tried this approach (http://bpm4everyone.blogspot.co.uk/2013/02/oracle-ssl-with-was.html) again. I seem to have made it a little further along. Now I'm getting an SSL handshake error:

[11/2/15 13:14:32:856 GMT-05:00] 0000007e DataSourceCon E   DSRA8040I: Failed to connect to the DataSource.  Encountered "": java.sql.SQLRecoverableException: IO Error: Received fatal alert: handshake_failure DSRA0010E: SQL State = 08006, Error Code = 17,002
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:752)
    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:662)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:560)
    at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:311)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:235)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:164)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:102)
    at com.ibm.ws.rsadapter.DSConfigHelper$1.run(DSConfigHelper.java:1266)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5384)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5600)
    at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
    at com.ibm.ws.rsadapter.spi.ServerFunction$6.run(ServerFunction.java:567)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    at com.ibm.ws.rsadapter.DSConfigHelper.getPooledConnection(DSConfigHelper.java:1281)
    at com.ibm.ws.rsadapter.DSConfigHelper.getPooledConnection(DSConfigHelper.java:1189)
    at com.ibm.ws.rsadapter.DSConfigurationHelper.getConnectionFromDSOrPooledDS(DSConfigurationHelper.java:2071)
    at com.ibm.ws.rsadapter.DSConfigurationHelper.getConnectionFromDSOrPooledDS(DSConfigurationHelper.java:1947)
    at com.ibm.ws.rsadapter.DSConfigurationHelper.testConnectionForGUI(DSConfigurationHelper.java:2814)
    at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at com.ibm.ws.management.DataSourceConfigHelperMBean.testConnectionToDataSource2(DataSourceConfigHelperMBean.java:556)
    at com.ibm.ws.management.DataSourceConfigHelperMBean.testConnection(DataSourceConfigHelperMBean.java:484)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:69)
    at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:272)
    at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1152)
    at java.security.AccessController.doPrivileged(AccessController.java:298)
    at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)
    at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1146)
    at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:999)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:847)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:783)
    at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
    at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
    at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java:488)
    at com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:324)
    at com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java:65)
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:733)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:522)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1864)
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at com.ibm.jsse2.o.a(o.java:30)
    at com.ibm.jsse2.o.a(o.java:23)
    at com.ibm.jsse2.SSLSocketImpl.b(SSLSocketImpl.java:356)
    at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:58)
    at com.ibm.jsse2.SSLSocketImpl.d(SSLSocketImpl.java:762)
    at com.ibm.jsse2.l.flush(l.java:13)
    at com.ibm.jsse2.kb.a(kb.java:223)
    at com.ibm.jsse2.lb.b(lb.java:15)
    at com.ibm.jsse2.lb.a(lb.java:306)
    at com.ibm.jsse2.lb.a(lb.java:156)
    at com.ibm.jsse2.kb.s(kb.java:659)
    at com.ibm.jsse2.kb.a(kb.java:393)
    at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:850)
    at com.ibm.jsse2.SSLSocketImpl.h(SSLSocketImpl.java:63)
    at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:200)
    at com.ibm.jsse2.k.write(k.java:11)
    at oracle.net.ns.Packet.send(Packet.java:419)
    at oracle.net.ns.ConnectPacket.send(ConnectPacket.java:241)
    at oracle.net.ns.NSProtocolStream.negotiateConnection(NSProtocolStream.java:157)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:264)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1452)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:496)
    ... 53 more

I tried different combinations of SSL versions and ciphers as described in those articles, in both the "connectionProperties" property of the data source and in the Oracle client's sqlnet.ora file. I keep getting the same handshake error.

hourback
  • 288
  • 1
  • 5
  • 16
  • FYI, my team finally solved this. I'm still writing up the documentation and will post it here when I'm done. – hourback Nov 12 '15 at 15:59
  • hi, i would be interesting in knowing a little bit more about that, how did you solve it ? because ORA-17002 is a known error – olivierg May 31 '17 at 20:43

1 Answers1

-1

Add javax.net.ssl.keyStore=/opt/oracle/wallet/client.wallet/ewallet.p12;javax.net.ssl.keyStoreType=PKCS12;java.net.ssl.keyStorePassword=password.