title: Connect to EMS JMS queue using Spring + SSL
body: <p>I'm having some issues to create a connection to (and reading from) a Tibco EMS JMS queue, using SSL and mutual authentication with certicates.
  Here is my Spring config:</p>
  
  <pre><code>&lt;!-- TIBCO Connection Factory Bean --&gt;
  &lt;bean id="tibcoConnectionFactory" class="com.tibco.tibjms.TibjmsConnectionFactory"&gt;
    &lt;constructor-arg value="ssl://mytibco.server.address:30113" /&gt;
    &lt;property name="userName" value="userName" /&gt;
    &lt;property name="userPassword" value="${tibcoPwd}" /&gt;
    &lt;property name="connAttemptCount" value="10" /&gt;
    &lt;property name="connAttemptDelay" value="100" /&gt;
    &lt;property name="connAttemptTimeout" value="1000" /&gt;
    &lt;property name="reconnAttemptCount" value="10" /&gt;
    &lt;property name="reconnAttemptDelay" value="100" /&gt;
    &lt;property name="reconnAttemptTimeout" value="1000" /&gt;
    &lt;property name="SSLVendor" value="j2se" /&gt;
    &lt;property name="SSLEnableVerifyHost" value="false" /&gt;
    &lt;property name="SSLEnableVerifyHostName" value="false" /&gt;
    &lt;property name="SSLTrace" value="true" /&gt;
    &lt;property name="SSLDebugTrace" value="true" /&gt;
    &lt;property name="SSLIdentity" value="c:\\cert\\testCert.p12" /&gt;
    &lt;property name="SSLPassword" value="*******" /&gt;
  &lt;/bean&gt;
  
  &lt;!-- Spring CachingConnectionFactory Bean --&gt;
  &lt;bean id="tibcoJmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory"&gt;
    &lt;constructor-arg ref="tibcoConnectionFactory" /&gt;
    &lt;property name="reconnectOnException" value="true" /&gt;
    &lt;property name="sessionCacheSize" value="10" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>When I try to put something on the queue, I receive the following stack trace:</p>
  
  <pre><code>[TIBCO EMS]: [J] [SSL] initializing security with vendor 'j2se'
  [TIBCO EMS]: [J] [SSL] client version 5.1.0, security version 3.0.0, SSL initialized with vendor 'j2se'
  [TIBCO EMS]: [J] [SSL] WARNING: server verification is disabled, will trust any server.
  [TIBCO EMS]: [J] [SSL] reading client identity from byte array, format=AUTO
  WARN  [jmsContainer-1] org.springframework.jms.listener.DefaultMessageListenerContainer - Execution of JMS message listener failed
  org.springframework.jms.JmsSecurityException: Error occured while reading identity data: Invalid or not supported identity data; nested exception is javax.jms.JMSSecurityException: Error occured while reading identity data: Invalid or not supported identity data
     at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:283)
     at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
     at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
     at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:436)
     ...
     at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543)
     at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482)
     at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
     at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
     at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:241)
     at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)
     at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
     at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
     at java.lang.Thread.run(Thread.java:662)
  Caused by: javax.jms.JMSSecurityException: Error occured while reading identity data: Invalid or not supported identity data
     at com.tibco.tibjms.TibjmsSSL._identityFromStore(TibjmsSSL.java:2670)
     at com.tibco.tibjms.TibjmsSSL.createIdentity(TibjmsSSL.java:2575)
     at com.tibco.tibjms.TibjmsxLinkSSL._initSSL(TibjmsxLinkSSL.java:309)
     at com.tibco.tibjms.TibjmsxLinkSSL.connect(TibjmsxLinkSSL.java:390)
     at com.tibco.tibjms.TibjmsConnection._create(TibjmsConnection.java:1288)
     at com.tibco.tibjms.TibjmsConnection.&lt;init&gt;(TibjmsConnection.java:4115)
     at com.tibco.tibjms.TibjmsxCFImpl._createImpl(TibjmsxCFImpl.java:209)
     at com.tibco.tibjms.TibjmsxCFImpl._createConnection(TibjmsxCFImpl.java:253)
     at com.tibco.tibjms.TibjmsConnectionFactory.createConnection(TibjmsConnectionFactory.java:36)
     at org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:343)
     at org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:290)
     at org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:227)
     at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
     at org.springframework.jms.core.JmsTemplate.access$500(JmsTemplate.java:90)
     at org.springframework.jms.core.JmsTemplate$JmsTemplateResourceFactory.createConnection(JmsTemplate.java:1028)
     at org.springframework.jms.connection.ConnectionFactoryUtils.doGetTransactionalSession(ConnectionFactoryUtils.java:298)
     at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:458)
     ... 12 more
  </code></pre>
  
  <p>Until now, I can't succeed to resolve the ssl handshake.
  How to resolve this issue?</p>