private SSLEngineConfigurator buildSslEngineConfigurator(Path certFile, Path keyFile, String keyPassword) throws GeneralSecurityException, IOException { if (keyFile == null || !Files.isRegularFile(keyFile) || !Files.isReadable(keyFile)) { throw new InvalidKeyException("Unreadable or missing private key: " + keyFile); } if (certFile == null || !Files.isRegularFile(certFile) || !Files.isReadable(certFile)) { throw new CertificateException("Unreadable or missing X.509 certificate: " + certFile); } final SSLContextConfigurator sslContextConfigurator = new SSLContextConfigurator(); final char[] password = firstNonNull(keyPassword, "").toCharArray(); final KeyStore keyStore = PemKeyStore.buildKeyStore(certFile, keyFile, password); sslContextConfigurator.setKeyStorePass(password); sslContextConfigurator.setKeyStoreBytes(KeyStoreUtils.getBytes(keyStore, password)); final SSLContext sslContext = sslContextConfigurator.createSSLContext(true); return new SSLEngineConfigurator(sslContext, false, false, false); }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
public SSLContext getSslContext() { if (sslContext == null) { synchronized(sync) { if (sslContext == null) { sslContext = sslContextConfiguration.createSSLContext(true); } } } return sslContext; }
/** * Create a new {@link SSLContext}. Note that if there are any problems with the key or trust stores, that no * exception will be thrown. * * @return a new {@link SSLContext} * * @deprecated Use {@link #createSSLContext(boolean)}. */ @Deprecated public SSLContext createSSLContext() { return createSSLContext(false); }
/** * Create a new {@link SSLContext}. Note that if there are any problems with the key or trust stores, that no * exception will be thrown. * * @return a new {@link SSLContext} * * @deprecated Use {@link #createSSLContext(boolean)}. */ @Deprecated public SSLContext createSSLContext() { return createSSLContext(false); }
/** * Create a new {@link SSLContext}. Note that if there are any problems with the key or trust stores, that no * exception will be thrown. * * @return a new {@link SSLContext} * * @deprecated Use {@link #createSSLContext(boolean)}. */ @Deprecated public SSLContext createSSLContext() { return createSSLContext(false); }
/** * Create a new {@link SSLContext}. Note that if there are any problems with the key or trust stores, that no * exception will be thrown. * * @return a new {@link SSLContext} * * @deprecated Use {@link #createSSLContext(boolean)}. */ @Deprecated public SSLContext createSSLContext() { return createSSLContext(false); }
/** * Create a new {@link SSLContext}. Note that if there are any problems with the key or trust stores, that no * exception will be thrown. * * @return a new {@link SSLContext} * * @deprecated Use {@link #createSSLContext(boolean)}. */ @Deprecated public SSLContext createSSLContext() { return createSSLContext(false); }
/** * Create a new {@link SSLContext}. Note that if there are any problems with the key or trust stores, that no * exception will be thrown. * * @return a new {@link SSLContext} * * @deprecated Use {@link #createSSLContext(boolean)}. */ @Deprecated public SSLContext createSSLContext() { return createSSLContext(false); }
/** * Create a new {@link SSLContext}. Note that if there are any problems with the key or trust stores, that no * exception will be thrown. * * @return a new {@link SSLContext} * * @deprecated Use {@link #createSSLContext(boolean)}. */ @Deprecated public SSLContext createSSLContext() { return createSSLContext(false); }
/** * Create a new {@link SSLContext}. Note that if there are any problems with the key or trust stores, that no * exception will be thrown. * * @return a new {@link SSLContext} * * @deprecated Use {@link #createSSLContext(boolean)}. */ @Deprecated public SSLContext createSSLContext() { return createSSLContext(false); }
/** * Create a new {@link SSLContext}. Note that if there are any problems with the key or trust stores, that no * exception will be thrown. * * @return a new {@link SSLContext} * * @deprecated Use {@link #createSSLContext(boolean)}. */ @Deprecated public SSLContext createSSLContext() { return createSSLContext(false); }