SSLEngine createSSLEngine() { return getService().createSSLEngineServer(); }
private TLSService(KeyManagerFactory keyManagerFactory, TrustManagerFactory trustManagerFactory, boolean trustAll, SecureRandom secureRandom) { try { //protocol The SSL/TLS protocol to be used. Java 1.6 will only run with up to TLSv1 protocol. Java 1.7 or higher also supports TLSv1.1 and TLSv1.2 protocols. final String PROTOCOL = "TLSv1.2"; final String PROTOCOL1_3 = "TLSv1.3"; //check Java version and move up to this ASAP. this.protocols = new String[]{PROTOCOL}; //[SSLv2Hello, TLSv1, TLSv1.1, TLSv1.2] KeyManager[] keyManagers = keyManagerFactory != null ? keyManagerFactory.getKeyManagers() : null; TrustManager[] trustManagers = null; if (trustAll) { trustManagers = TLSCertificateTrust.trustManagerFactoryTrustAllCerts(); } else if (trustManagerFactory != null) { trustManagers = trustManagerFactory.getTrustManagers(); } context = SSLContext.getInstance(PROTOCOL); context.init(keyManagers, trustManagers, secureRandom); } catch (Exception e) { throw new RuntimeException(e); } //run once first to determine which cypher suites we will be using. createSSLEngineServer(); }
private TLSService(KeyManagerFactory keyManagerFactory, TrustManagerFactory trustManagerFactory, boolean trustAll, SecureRandom secureRandom) { try { this.protocols = selectSupportedProtocols(); KeyManager[] keyManagers = keyManagerFactory != null ? keyManagerFactory.getKeyManagers() : null; TrustManager[] trustManagers = null; if (trustAll) { trustManagers = TLSCertificateTrust.trustManagerFactoryTrustAllCerts(); } else if (trustManagerFactory != null) { trustManagers = trustManagerFactory.getTrustManagers(); } context = SSLContext.getInstance(this.protocols[0]); context.init(keyManagers, trustManagers, secureRandom); } catch (Exception e) { throw new RuntimeException(e); } //run once first to determine which cypher suites we will be using. createSSLEngineServer(); }
private TLSService(KeyManagerFactory keyManagerFactory, TrustManagerFactory trustManagerFactory, boolean trustAll, SecureRandom secureRandom) { try { this.protocols = selectSupportedProtocols(); KeyManager[] keyManagers = keyManagerFactory != null ? keyManagerFactory.getKeyManagers() : null; TrustManager[] trustManagers = null; if (trustAll) { trustManagers = TLSCertificateTrust.trustManagerFactoryTrustAllCerts(); } else if (trustManagerFactory != null) { trustManagers = trustManagerFactory.getTrustManagers(); } context = SSLContext.getInstance(this.protocols[0]); context.init(keyManagers, trustManagers, secureRandom); } catch (Exception e) { throw new RuntimeException(e); } //run once first to determine which cypher suites we will be using. createSSLEngineServer(); }