protected Transport createTransport() throws JMSException { // If the given URI is non-ssl, let superclass handle it. if (!brokerURL.getScheme().equals("ssl")) { return super.createTransport(); } ConvenientSslContextFactory convenientSslContextFactory = new ConvenientSslContextFactory(trustStore, trustStorePassword, keyStore, keyStorePassword); if (keyManager == null && notEmpty(keyStore)) { keyManager = convenientSslContextFactory.getKeyManagers(); } if (trustManager == null && notEmpty(trustStore)) { trustManager = convenientSslContextFactory.getTrustManagers(); } return super.createTransport(); }