Creating SSL enabled InitialContext with Spring JndiTemplate
lifeonatrip Dec 13, 2013 12:21 AMHi Everyone,
We are trying to create SSL enabled InitialContext with Spring JndiTemplate. The below is our configuration. Our configuration is working via remote interface without SSL enabled. We are using JBoss 7.2 and our remote EJB's are working over ssl, so the assumption is that it is a client configuration issue. Please see error below also.
ERROR [org.jboss.remoting.remote.connection] (Remoting "config-based-naming-client-endpoint" read-1) JBREM000200: Remote connection failed: java.io.IOException: Client starting STARTTLS but channel doesn't support SSL
Client conf.
<bean id="remoteJndiTemplate" class="org.springframework.jndi.JndiTemplate"> <property name="environment"> <props> <prop key="remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED">true</prop> <prop key="java.naming.factory.initial">org.jboss.naming.remote.client.InitialContextFactory </prop> <prop key="java.naming.provider.url">remote://my-ip:4447</prop> </props> </property> </bean> <bean id="remoteJmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:/jms/RemoteConnectionFactory</value> </property> <property name="jndiTemplate"> <ref bean="remoteJndiTemplate" /> </property> </bean> <bean id="remoteAuthenticatedConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter"> <property name="targetConnectionFactory" ref="remoteJmsConnectionFactory" /> <property name="username" value="messaging_client" /> <property name="password" value="password" /> </bean> <bean id="remoteCachedConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory"> <constructor-arg ref="remoteAuthenticatedConnectionFactory" /> </bean>
server conf.
<security-realm name="ApplicationRealm"> <authentication> <jaas name="myjaas"/> </authentication> <server-identities> <ssl> <keystore path="mykeystore.ks" password="changeit" relative-to="jboss.server.config.dir"/> </ssl> </server-identities> </security-realm>
<subsystem xmlns="urn:jboss:domain:remoting:1.1"> <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/> </subsystem>
Thanks in advance.