Describe the bug
In TlsUtil.keyManager(), the KeyManagerFactory is instantiated using the default algorithm of TrustManagerFactory instead of KeyManagerFactory:
|
KeyManagerFactory kmf = |
|
KeyManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); |
Why it matters
Depending on the JVM configuration, the default algorithm for TrustManagerFactory may not be a valid algorithm name for KeyManagerFactory, which would cause a NoSuchAlgorithmException.
Expected behavior
KeyManagerFactory kmf =
KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());