Cannot search if SSL is enabled in Websphere 8.5

I wrote a simple ejb thin client to find the bean deployed in IBM WebSphere 8.5.

When SSL was not enabled on the server, I was able to successfully find the bean, but as soon as I turned on SSL, I started getting the exception below.

Here's how I turned on protection through the admin console: enter image description here

An exception:

javax.naming.NamingException: Error getting WsnNameService properties [Root exception is org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible vmcid: IBM minor code: E07 completed: No] at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1552) at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:1042) at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:962) at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:614) at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128) at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765) at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164) at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179) at javax.naming.InitialContext.lookup(InitialContext.java:436) at nh.indi.test.S2SCommTest.lookupServiceEJB(S2SCommTest.java:55) at nh.indi.test.S2SCommTest.main(S2SCommTest.java:22) Caused by: org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible vmcid: IBM minor code: E07 completed: No at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1276) at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1342) at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1164) at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1308) at com.ibm.rmi.corba.ClientDelegate.request(ClientDelegate.java:1886) at com.ibm.CORBA.iiop.ClientDelegate.request(ClientDelegate.java:1264) at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:458) at com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:38) at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1549) ... 10 more 

Code:

 public static void main(String args[]) throws NamingException { Properties ejbProps = new Properties(); ejbProps.put("org.omg.CORBA.ORBClass", "com.ibm.CORBA.iiop.ORB"); ejbProps.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); ejbProps.put(Context.PROVIDER_URL, "corbaloc:iiop:160.XX.XX.XX:2809"); InitialContext ffmContext = new InitialContext(ejbProps); Object remoteObject = ffmContext .lookup("ejb/MyAppEar-CLUSTER/MyAppEJB.jar/BatchIdTrackingBean#indi.nh.business.framework.bos.di.BatchIdTrackingBeanRemote"); BatchIdTrackingBeanRemote serviceTester = (BatchIdTrackingBeanRemote) PortableRemoteObject .narrow(remoteObject, BatchIdTrackingBeanRemote.class); System.out.println(serviceTester); } 

When the program starts, I also pass the location of the sas.client.props file located on my local file system, as indicated here. 1

 -Dcom.ibm.CORBA.ConfigURL=file:///C:/Temp/docs/S2S_Docs/sas.client.props 

1 : How to connect to the Application Server 8.5 Message Queue web server while administrative security is enabled

Can someone please help me how to successfully test it with SSL enabled on the websphere application server or what I am missing in the configuration on the client side or on the server.

+3
source share
1 answer

You also need to add this property to the java command: -Dcom.ibm.CORBA.ConfigURL = file: ///home/user1/sas.client.props

You can copy the ssl.client.props file (in addition to sas.client.props) from the WebSphere Application Server installation. At the very least, you need to update the location of the key files in the ssl.client.props file to match where you created or copied the key files. For instance,

-Dcom.ibm.ssl.keyStore = / home / user1 / etc. /key.p12 -Dcom.ibm.ssl.trustStore = / house / user1 / etc. /trust.p12

When you start the client again, it should ask you to add a subscriber to the trust store if it does not exist.

More details: https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/tcli_ejbthinclient.html

+3
source

Source: https://habr.com/ru/post/1242738/


All Articles