Skip to content

No support for keystore aliases. #656

@mdemare

Description

@mdemare

Keystores, which clj-http supports, may contain multiple entries. To determine which one is selected, keystore aliases are used. Failing to specify an alias for a keystore with multiple entries means that the first entry is used.

The code which fails to specify an alias is the ssl-context-for-keystore function in the clj-http.conn-mgr namespace.

(.loadKeyMaterial
         ks (when keystore-pass
              (.toCharArray keystore-pass)))

uses the loadKeyMaterial method with signature java.security.KeyStore keystore, char[] keyPassword, but for alias support, the method with signature java.security.KeyStore keystore, char[] keyPassword, PrivateKeyStrategy aliasStrategy is needed. The chooseAlias method can just return the alias name if it occurs in the map, and the alias-name can be passed as keystore-alias in the arguments to ssl-context-for-keystore.

This does not apply to truststores.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions