New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PEM support to cli #9497
Add PEM support to cli #9497
Conversation
Nit: uppercase "CLI" in commit message and write "KeyStore" and "TrustStore" |
Actually, this adds support to both CLI and JDBC |
@@ -170,6 +182,31 @@ public static void setupSsl( | |||
} | |||
} | |||
|
|||
private static KeyStore loadTrustStore(File trustStorePath, Optional<String> trustStorePassword) | |||
throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be IOException, GeneralSecurityException
} | ||
} | ||
} | ||
catch (IOException | GeneralSecurityException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to ignored
trustStore.load(null, null); | ||
for (X509Certificate certificate : certificateChain) { | ||
X500Principal principal = certificate.getSubjectX500Principal(); | ||
trustStore.setCertificateEntry(principal.getName("RFC2253"), certificate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use getName()
which is the same. BTW, there's also a X500Principal.RFC2253
constant
Existing keystore and truststore properties can now be used for PEM files in the CLI
Existing keystore and truststore properties can now be used for PEM files in the CLI