Remove TLSv1 as default protocol (#303)
| | |
| | | |
| | | private TrustManager trustManager; |
| | | private KeyManager keyManager; |
| | | private String protocol = PROTOCOL_TLS1_2; |
| | | private String protocol = PROTOCOL_TLS; |
| | | private SecureRandom random; |
| | | |
| | | /** These are mutually exclusive. */ |
| | |
| | | : SelectableCertificateKeyManager.wrap(provider.getKeyManagers(), nicknames); |
| | | } |
| | | |
| | | SSLContext ctx = SSLContext.getInstance("TLSv1"); |
| | | SSLContext ctx = SSLContext.getInstance("TLS"); |
| | | ctx.init( |
| | | keyManagers, |
| | | null, |
| | |
| | | } |
| | | catch (NoSuchAlgorithmException ex) |
| | | { |
| | | logger.trace("Unable to retrieve default TLS protocols of the JVM, defaulting to TLSv1", ex); |
| | | protocols = Arrays.asList(SSLContextBuilder.PROTOCOL_TLS1); |
| | | logger.trace("Unable to retrieve default TLS protocols of the JVM, defaulting to TLS", ex); |
| | | protocols = Arrays.asList(SSLContextBuilder.PROTOCOL_TLS); |
| | | } |
| | | TLS_PROTOCOLS = protocols.toArray(new String[protocols.size()]); |
| | | } |
| | |
| | | |
| | | private Socket getSslSocket(String host, int port) throws Exception |
| | | { |
| | | SSLContext sslCtx = SSLContext.getInstance("TLSv1"); |
| | | SSLContext sslCtx = SSLContext.getInstance("TLS"); |
| | | TrustManager[] tm = new TrustManager[] { new BlindTrustManager() }; |
| | | sslCtx.init(null, tm, new SecureRandom()); |
| | | SSLSocketFactory socketFactory = sslCtx.getSocketFactory(); |