Elffuss BraidHub

kikocis/java-driver public

Use SSLContext.getDefault() in default SSLOptions.

The way we built the SSLContext before, it would ignore keystore system
properties (javax.net.ssl.keyStore and javax.net.ssl.keyStorePassword).
We provide the default implementation for people who have a simple
configuration that should require no code, so it makes sense that it
would honor those properties.
Changeset53db560e9d5adc4ce626c712d384b8929b72fd6d3a905f5a0331c8b2aa00ede9
Authorolim7t <omichallat+github@gmail.com> · 2015-11-02 22:04 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2015-11-05 18:54 +01:00
Parents3168d4757d5a

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/SSLOptions.java +1 −7
@@ -24,8 +24,6 @@
2424 */
2525 public class SSLOptions {
2626
27- private static final String SSL_PROTOCOL = "TLS";
28-
2927 /**
3028 * The default SSL cipher suites.
3129 */
@@ -63,12 +61,8 @@
6361
6462 private static SSLContext makeDefaultContext() throws IllegalStateException {
6563 try {
66- SSLContext ctx = SSLContext.getInstance(SSL_PROTOCOL);
67- ctx.init(null, null, null); // use defaults
68- return ctx;
64+ return SSLContext.getDefault();
6965 } catch (NoSuchAlgorithmException e) {
70- throw new RuntimeException("This JVM doesn't support TLS, this shouldn't happen");
71- } catch (KeyManagementException e) {
7266 throw new IllegalStateException("Cannot initialize SSL Context", e);
7367 }
7468 }