How to import an existing X.509 certificate and private key in Java keystore to use in SSL?

I have this in an ActiveMQ config: <sslContext> <sslContext keyStore=”file:/home/alex/work/amq/broker.ks” keyStorePassword=”password” trustStore=”file:${activemq.base}/conf/broker.ts” trustStorePassword=”password”/> </sslContext> I have a pair of X.509 cert and a key file. How do I import those two in order to use them in SSL and SSL+stomp connectors? All examples I could google always generate the key themselves, but I already have … Read more

Caused by: java.security.UnrecoverableKeyException: Cannot recover key

I am supplied with a jks keystore named ABCC_client.store. When I import this keystore to cacerts and try connecting it says No such Algorithm error. PFA the stacktrace Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl) at java.security.Provider$Service.newInstance(Provider.java:1245) at sun.security.jca.GetInstance.getInstance(GetInstance.java:220) at sun.security.jca.GetInstance.getInstance(GetInstance.java:147) at javax.net.ssl.SSLContext.getInstance(SSLContext.java:125) at javax.net.ssl.SSLContext.getDefault(SSLContext.java:68) at javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:102) at org.apache.axis.components.net.JSSESocketFactory.initFactory(JSSESocketFactory.java:61) at … Read more