I've built a Java program as a front end for a database on a server, and I'm trying to use SSL to encrypt traffic between clients and the server. Here is the command I issued to create the server certificate:
keytool -genkey -alias localhost -keyalg RSA -keypass kpass123 -storepass kpass123 -keystore keystore.jks
SSLServerSocketFactory factory =
SSLServerSocket accessSocket =
java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)
javax.net.ssl.keyStorePassword instead of
javax.net.ssl.keyPassword: the latter isn't mentioned in the JSSE ref guide.
The algorithms you mention should be there by default using the default security providers.
NoSuchAlgorithmExceptions are often cause by other underlying exceptions (file not found, wrong password, wrong keystore type, ...). It's useful to look at the full stack trace.
You could also use
-Djavax.net.debug=ssl, or at least
-Djavax.net.debug=ssl,keymanager, to get more debugging information, if the information in the stack trace isn't sufficient.