title: Communicating with AMQP 1.0 broker over SSL using Qpid
body: <p>I am using ActiveMQ 5.8.0, which supports AMQP 1.0 as a queue broker. I am trying to communicate with this from a Java client using the Qpid AMQP1.0 client jms library but do not see a method of specifying keystore and truststore information.</p>
  
  <p>I have successfully configured a client by passing in the SSL credentials via the Java VM options (e.g. -Djavax.net.ssl.keyStore), however this is not an acceptable method for my final solution... I need to be able to specify this information from within the code.</p>
  
  <p>I am currently using the createFromURL method to generate the connection from a URL that includes SSL parameters as defined <a href="http://qpid.apache.org/releases/qpid-0.24/programming/book/QpidJNDI.html#section-jms-connection-url" rel="nofollow">here</a>, but the keystore information (and potentially failover params) do not appear to be parsed from the URL.</p>
  
  <pre><code>String connectionUrl = "amqps://localhost/?brokerlist='tcp://localhost:5671?ssl='true'&amp;key_store='C:/apache-activemq-5.8.0/conf/client.ks'&amp;key_store_password='password'&amp;trust_store='C:/apache-activemq-5.8.0/conf/client.ts'&amp;trust_store_password='password'";
  ConnectionFactoryImpl connectionFactory = ConnectionFactoryImpl.createFromURL(connectionUrl); 
  </code></pre>
  
  <p>Does anyone know a better way of providing the security information into the connection?</p>
  
  <p><strong>Update:</strong>
  Right, so doing some digging through the API I have identified that the library uses the Default SSLSocketFactory</p>
  
  <p>See: org.apache.qpid.amqp_1_0.client.Connection</p>
  
  <pre><code>final Socket s;
  if(ssl)
  {
      s = SSLSocketFactory.getDefault().createSocket(address, port);
  }
  </code></pre>
  
  <p>Therefore, there seems no way of specifying this information outside of the JVM options to set the default values... at least in the current version of the Qpid client library.</p>