Skip to content

TlsUtil.keyManager() uses TrustManagerFactory.getDefaultAlgorithm() to initialize KeyManagerFactory #8112

@lbarrios

Description

@lbarrios

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions