Skip to content
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

Merged
merged 1 commit into from Dec 6, 2017
Merged

Add PEM support to cli #9497

merged 1 commit into from Dec 6, 2017

Conversation

dain
Copy link
Contributor

@dain dain commented Dec 6, 2017

Existing keystore and truststore properties can now be used for PEM files in the CLI

@electrum
Copy link
Contributor

electrum commented Dec 6, 2017

Nit: uppercase "CLI" in commit message and write "KeyStore" and "TrustStore"

@electrum
Copy link
Contributor

electrum commented Dec 6, 2017

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
Copy link
Contributor

@electrum electrum Dec 6, 2017

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) {
Copy link
Contributor

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);
Copy link
Contributor

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
@dain dain closed this Dec 6, 2017
@dain dain deleted the client-pem branch December 6, 2017 21:47
@dain dain merged commit d8692ec into prestodb:master Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants