palantir / palantir/conjure-java-runtime

Accept keystore password also for truststore.

Open
#2,248 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
95
Forks
96
Avg merge
3h 38m
Merged PRs (30d)
33

Description

What happened?

keytool (and the JDK in general) is moving away from the proprietary JKS format and over to the wider used standardized PKCS12 format (JEP 229). The default format for keytool for example, is as of JDK 9, PKCS12 instead of JKS.

One difference between these two formats is that PKCS12 requires password protection also for public certificates. (At least to the extent of my knowledge. I've managed to create a PKCS12 keystore programatically with an empty password, but not without a password.)

In a JKS keystore you may have noticed that keytool -list can show public certificates, even if you just hit enter at the password prompt. As for PKCS12 keystores this is not the case.

In our SslSocketFactories class we've hardcoded the choice to use no password at all when loading the truststore:

https://github.com/palantir/conjure-java-runtime/blob/478f5d184e2961fa72fcef54bf24a7346f25df7b/keystores/src/main/java/com/palantir/conjure/java/config/ssl/SslSocketFactories.java#L261

What did you want to happen?

I would suggest we extend the SslConfiguration class which now accepts...

  • trustStorePath
  • keyStorePath
  • keyStorePassword

...to also include

  • trustStorePassword

and make use of this value when loading truststore certificates in the line linked above.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SslConfiguration and SslSocketFactories.java at the linked truststore-loading code. Trace how keyStorePassword is represented and passed through the configuration, then determine where trustStorePassword should follow the same path. Done means PKCS12 truststores can be loaded with their configured password while existing configurations continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.