@Test public void build() throws Exception { builder = new SSLConnectionSocketFactoryBuilder() { protected void createTrustKeystore(SSLContextBuilder sslContextBuilder, boolean useTrustCert) { } protected void createKeystore(SSLContextBuilder sslContextBuilder, boolean useClientCert) { } }; mockStatic(SSLContexts.class); mockStatic(System.class); when(SSLContexts.custom()).thenReturn(sslContextBuilderMock); when(System.getProperty("java.home")).thenReturn("javaHome"); whenNew(File.class).withArguments(anyString()).thenReturn(fileMock); when(fileMock.exists()).thenReturn(true); when(sslContextBuilderMock.useSSL()).thenReturn(null); when(sslContextBuilderMock.useTLS()).thenReturn(null); when(sslContextBuilderMock.build()).thenReturn(sslCtxMock); prepareSSLConnectionSocketFactory(); SSLConnectionSocketFactory sslsf = builder.build(); assertNotNull(sslsf); assertEquals(sslsfMock, sslsf); }
public SSLConnectionSocketFactory build() { if (!"true".equalsIgnoreCase(trustAllRootsStr) && !"false".equalsIgnoreCase(trustAllRootsStr)) { throw new IllegalArgumentException("'trustAllRoots' can only be 'true' or 'false'"); } boolean trustAllRoots = Boolean.parseBoolean(trustAllRootsStr); SSLContextBuilder sslContextBuilder = SSLContexts.custom(); String changeit = "changeit"; String javaKeystore = System.getProperty("java.home") + "/lib/security/cacerts"; if (!trustAllRoots) { boolean useClientCert = StringUtils.isNotEmpty(keystore); boolean useTrustCert = StringUtils.isNotEmpty(trustKeystore); boolean storeExists = new File(javaKeystore).exists(); if (!useClientCert && storeExists) { keystore = "file:" + javaKeystore; keystorePassword = StringUtils.isNotEmpty(keystorePassword) ? keystorePassword : changeit; useClientCert = true; } else if (useClientCert && !keystore.startsWith("http")) { keystore = "file:" + keystore; } if (!useTrustCert && storeExists) { trustKeystore = "file:" + javaKeystore; trustPassword = StringUtils.isNotEmpty(trustPassword) ? trustPassword : changeit; useTrustCert = true; } else if (useTrustCert && !trustKeystore.startsWith("http")) { trustKeystore = "file:" + trustKeystore; } createTrustKeystore(sslContextBuilder, useTrustCert); createKeystore(sslContextBuilder, useClientCert); } else { try { KeyStore keyStore = createKeyStore(new URL("file:" + keystore), keystorePassword); sslContextBuilder.loadKeyMaterial(keyStore, keystorePassword.toCharArray()); String internalJavaKeystoreUri = "file:" + javaKeystore; KeyStore javaTrustStore = createKeyStore(new URL(internalJavaKeystoreUri), changeit); sslContextBuilder.loadTrustMaterial(javaTrustStore, new TrustSelfSignedStrategy() { @Override public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { return true; } }); } catch (Exception e) { throw new IllegalArgumentException(e.getMessage() + ". " + TRUST_ALL_ROOTS_ERROR + trustAllRoots, e); } } sslContextBuilder.useSSL(); sslContextBuilder.useTLS(); SSLConnectionSocketFactory sslsf = null; try { String x509HostnameVerifierStr = x509HostnameVerifierInputValue.toLowerCase(); X509HostnameVerifier x509HostnameVerifier; switch (x509HostnameVerifierStr) { case "strict": x509HostnameVerifier = SSLConnectionSocketFactory.STRICT_HOSTNAME_VERIFIER; break; case "browser_compatible": x509HostnameVerifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; break; case "allow_all": x509HostnameVerifier = SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER; break; default: throw new IllegalArgumentException("Invalid value '" + x509HostnameVerifierInputValue + "' for input 'x509HostnameVerifier'. Valid values: 'strict','browser_compatible','allow_all'."); } if (!StringUtils.isEmpty(inputTLS)) { Set<String> protocolSet = new HashSet<>(Arrays.asList(inputTLS.trim().split(","))); String[] protocolArray = protocolSet.toArray(new String[0]); if (!checkEquality(protocolArray, SUPPORTED_PROTOCOLS)) { throw new IllegalArgumentException("Protocol not supported"); } if (checkIfTLS2(protocolArray, TLSv12)) flag = true; if (!StringUtils.isEmpty(inputCyphers)) cypherArray = inputCyphers.trim().split(","); if (flag) { if (cypherArray != null) { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), ARRAY_TLSv12, cypherArray, x509HostnameVerifier); } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), SUPPORTED_PROTOCOLS, null, x509HostnameVerifier); } } catch (Exception e) { if (e instanceof IllegalArgumentException) { throw new IllegalArgumentException(e.getMessage()); } throw new RuntimeException(e.getMessage() + ". " + SSL_CONNECTION_ERROR, e); } return sslsf; }
SSLConnectionSocketFactoryBuilder { public SSLConnectionSocketFactory build() { if (!"true".equalsIgnoreCase(trustAllRootsStr) && !"false".equalsIgnoreCase(trustAllRootsStr)) { throw new IllegalArgumentException("'trustAllRoots' can only be 'true' or 'false'"); } boolean trustAllRoots = Boolean.parseBoolean(trustAllRootsStr); SSLContextBuilder sslContextBuilder = SSLContexts.custom(); String changeit = "changeit"; String javaKeystore = System.getProperty("java.home") + "/lib/security/cacerts"; if (!trustAllRoots) { boolean useClientCert = StringUtils.isNotEmpty(keystore); boolean useTrustCert = StringUtils.isNotEmpty(trustKeystore); boolean storeExists = new File(javaKeystore).exists(); if (!useClientCert && storeExists) { keystore = "file:" + javaKeystore; keystorePassword = StringUtils.isNotEmpty(keystorePassword) ? keystorePassword : changeit; useClientCert = true; } else if (useClientCert && !keystore.startsWith("http")) { keystore = "file:" + keystore; } if (!useTrustCert && storeExists) { trustKeystore = "file:" + javaKeystore; trustPassword = StringUtils.isNotEmpty(trustPassword) ? trustPassword : changeit; useTrustCert = true; } else if (useTrustCert && !trustKeystore.startsWith("http")) { trustKeystore = "file:" + trustKeystore; } createTrustKeystore(sslContextBuilder, useTrustCert); createKeystore(sslContextBuilder, useClientCert); } else { try { KeyStore keyStore = createKeyStore(new URL("file:" + keystore), keystorePassword); sslContextBuilder.loadKeyMaterial(keyStore, keystorePassword.toCharArray()); String internalJavaKeystoreUri = "file:" + javaKeystore; KeyStore javaTrustStore = createKeyStore(new URL(internalJavaKeystoreUri), changeit); sslContextBuilder.loadTrustMaterial(javaTrustStore, new TrustSelfSignedStrategy() { @Override public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { return true; } }); } catch (Exception e) { throw new IllegalArgumentException(e.getMessage() + ". " + TRUST_ALL_ROOTS_ERROR + trustAllRoots, e); } } sslContextBuilder.useSSL(); sslContextBuilder.useTLS(); SSLConnectionSocketFactory sslsf = null; try { String x509HostnameVerifierStr = x509HostnameVerifierInputValue.toLowerCase(); X509HostnameVerifier x509HostnameVerifier; switch (x509HostnameVerifierStr) { case "strict": x509HostnameVerifier = SSLConnectionSocketFactory.STRICT_HOSTNAME_VERIFIER; break; case "browser_compatible": x509HostnameVerifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; break; case "allow_all": x509HostnameVerifier = SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER; break; default: throw new IllegalArgumentException("Invalid value '" + x509HostnameVerifierInputValue + "' for input 'x509HostnameVerifier'. Valid values: 'strict','browser_compatible','allow_all'."); } if (!StringUtils.isEmpty(inputTLS)) { Set<String> protocolSet = new HashSet<>(Arrays.asList(inputTLS.trim().split(","))); String[] protocolArray = protocolSet.toArray(new String[0]); if (!checkEquality(protocolArray, SUPPORTED_PROTOCOLS)) { throw new IllegalArgumentException("Protocol not supported"); } if (checkIfTLS2(protocolArray, TLSv12)) flag = true; if (!StringUtils.isEmpty(inputCyphers)) cypherArray = inputCyphers.trim().split(","); if (flag) { if (cypherArray != null) { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), ARRAY_TLSv12, cypherArray, x509HostnameVerifier); } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), SUPPORTED_PROTOCOLS, null, x509HostnameVerifier); } } catch (Exception e) { if (e instanceof IllegalArgumentException) { throw new IllegalArgumentException(e.getMessage()); } throw new RuntimeException(e.getMessage() + ". " + SSL_CONNECTION_ERROR, e); } return sslsf; } }
SSLConnectionSocketFactoryBuilder { public SSLConnectionSocketFactory build() { if (!"true".equalsIgnoreCase(trustAllRootsStr) && !"false".equalsIgnoreCase(trustAllRootsStr)) { throw new IllegalArgumentException("'trustAllRoots' can only be 'true' or 'false'"); } boolean trustAllRoots = Boolean.parseBoolean(trustAllRootsStr); SSLContextBuilder sslContextBuilder = SSLContexts.custom(); String changeit = "changeit"; String javaKeystore = System.getProperty("java.home") + "/lib/security/cacerts"; if (!trustAllRoots) { boolean useClientCert = StringUtils.isNotEmpty(keystore); boolean useTrustCert = StringUtils.isNotEmpty(trustKeystore); boolean storeExists = new File(javaKeystore).exists(); if (!useClientCert && storeExists) { keystore = "file:" + javaKeystore; keystorePassword = StringUtils.isNotEmpty(keystorePassword) ? keystorePassword : changeit; useClientCert = true; } else if (useClientCert && !keystore.startsWith("http")) { keystore = "file:" + keystore; } if (!useTrustCert && storeExists) { trustKeystore = "file:" + javaKeystore; trustPassword = StringUtils.isNotEmpty(trustPassword) ? trustPassword : changeit; useTrustCert = true; } else if (useTrustCert && !trustKeystore.startsWith("http")) { trustKeystore = "file:" + trustKeystore; } createTrustKeystore(sslContextBuilder, useTrustCert); createKeystore(sslContextBuilder, useClientCert); } else { try { KeyStore keyStore = createKeyStore(new URL("file:" + keystore), keystorePassword); sslContextBuilder.loadKeyMaterial(keyStore, keystorePassword.toCharArray()); String internalJavaKeystoreUri = "file:" + javaKeystore; KeyStore javaTrustStore = createKeyStore(new URL(internalJavaKeystoreUri), changeit); sslContextBuilder.loadTrustMaterial(javaTrustStore, new TrustSelfSignedStrategy() { @Override public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { return true; } }); } catch (Exception e) { throw new IllegalArgumentException(e.getMessage() + ". " + TRUST_ALL_ROOTS_ERROR + trustAllRoots, e); } } sslContextBuilder.useSSL(); sslContextBuilder.useTLS(); SSLConnectionSocketFactory sslsf = null; try { String x509HostnameVerifierStr = x509HostnameVerifierInputValue.toLowerCase(); X509HostnameVerifier x509HostnameVerifier; switch (x509HostnameVerifierStr) { case "strict": x509HostnameVerifier = SSLConnectionSocketFactory.STRICT_HOSTNAME_VERIFIER; break; case "browser_compatible": x509HostnameVerifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; break; case "allow_all": x509HostnameVerifier = SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER; break; default: throw new IllegalArgumentException("Invalid value '" + x509HostnameVerifierInputValue + "' for input 'x509HostnameVerifier'. Valid values: 'strict','browser_compatible','allow_all'."); } if (!StringUtils.isEmpty(inputTLS)) { Set<String> protocolSet = new HashSet<>(Arrays.asList(inputTLS.trim().split(","))); String[] protocolArray = protocolSet.toArray(new String[0]); if (!checkEquality(protocolArray, SUPPORTED_PROTOCOLS)) { throw new IllegalArgumentException("Protocol not supported"); } if (checkIfTLS2(protocolArray, TLSv12)) flag = true; if (!StringUtils.isEmpty(inputCyphers)) cypherArray = inputCyphers.trim().split(","); if (flag) { if (cypherArray != null) { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), ARRAY_TLSv12, cypherArray, x509HostnameVerifier); } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), SUPPORTED_PROTOCOLS, null, x509HostnameVerifier); } } catch (Exception e) { if (e instanceof IllegalArgumentException) { throw new IllegalArgumentException(e.getMessage()); } throw new RuntimeException(e.getMessage() + ". " + SSL_CONNECTION_ERROR, e); } return sslsf; }  }
SSLConnectionSocketFactoryBuilder { public SSLConnectionSocketFactory build() { if (!"true".equalsIgnoreCase(trustAllRootsStr) && !"false".equalsIgnoreCase(trustAllRootsStr)) { throw new IllegalArgumentException("'trustAllRoots' can only be 'true' or 'false'"); } boolean trustAllRoots = Boolean.parseBoolean(trustAllRootsStr); SSLContextBuilder sslContextBuilder = SSLContexts.custom(); String changeit = "changeit"; String javaKeystore = System.getProperty("java.home") + "/lib/security/cacerts"; if (!trustAllRoots) { boolean useClientCert = StringUtils.isNotEmpty(keystore); boolean useTrustCert = StringUtils.isNotEmpty(trustKeystore); boolean storeExists = new File(javaKeystore).exists(); if (!useClientCert && storeExists) { keystore = "file:" + javaKeystore; keystorePassword = StringUtils.isNotEmpty(keystorePassword) ? keystorePassword : changeit; useClientCert = true; } else if (useClientCert && !keystore.startsWith("http")) { keystore = "file:" + keystore; } if (!useTrustCert && storeExists) { trustKeystore = "file:" + javaKeystore; trustPassword = StringUtils.isNotEmpty(trustPassword) ? trustPassword : changeit; useTrustCert = true; } else if (useTrustCert && !trustKeystore.startsWith("http")) { trustKeystore = "file:" + trustKeystore; } createTrustKeystore(sslContextBuilder, useTrustCert); createKeystore(sslContextBuilder, useClientCert); } else { try { KeyStore keyStore = createKeyStore(new URL("file:" + keystore), keystorePassword); sslContextBuilder.loadKeyMaterial(keyStore, keystorePassword.toCharArray()); String internalJavaKeystoreUri = "file:" + javaKeystore; KeyStore javaTrustStore = createKeyStore(new URL(internalJavaKeystoreUri), changeit); sslContextBuilder.loadTrustMaterial(javaTrustStore, new TrustSelfSignedStrategy() { @Override public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { return true; } }); } catch (Exception e) { throw new IllegalArgumentException(e.getMessage() + ". " + TRUST_ALL_ROOTS_ERROR + trustAllRoots, e); } } sslContextBuilder.useSSL(); sslContextBuilder.useTLS(); SSLConnectionSocketFactory sslsf = null; try { String x509HostnameVerifierStr = x509HostnameVerifierInputValue.toLowerCase(); X509HostnameVerifier x509HostnameVerifier; switch (x509HostnameVerifierStr) { case "strict": x509HostnameVerifier = SSLConnectionSocketFactory.STRICT_HOSTNAME_VERIFIER; break; case "browser_compatible": x509HostnameVerifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; break; case "allow_all": x509HostnameVerifier = SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER; break; default: throw new IllegalArgumentException("Invalid value '" + x509HostnameVerifierInputValue + "' for input 'x509HostnameVerifier'. Valid values: 'strict','browser_compatible','allow_all'."); } if (!StringUtils.isEmpty(inputTLS)) { Set<String> protocolSet = new HashSet<>(Arrays.asList(inputTLS.trim().split(","))); String[] protocolArray = protocolSet.toArray(new String[0]); if (!checkEquality(protocolArray, SUPPORTED_PROTOCOLS)) { throw new IllegalArgumentException("Protocol not supported"); } if (checkIfTLS2(protocolArray, TLSv12)) flag = true; if (!StringUtils.isEmpty(inputCyphers)) cypherArray = inputCyphers.trim().split(","); if (flag) { if (cypherArray != null) { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), ARRAY_TLSv12, cypherArray, x509HostnameVerifier); } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), SUPPORTED_PROTOCOLS, null, x509HostnameVerifier); } } catch (Exception e) { if (e instanceof IllegalArgumentException) { throw new IllegalArgumentException(e.getMessage()); } throw new RuntimeException(e.getMessage() + ". " + SSL_CONNECTION_ERROR, e); } return sslsf; }  static boolean checkEquality(String[] subArray, String[] largeArray); static boolean checkIfTLS2(String[] arr, String targetValue); SSLConnectionSocketFactory build(); SSLConnectionSocketFactoryBuilder setTrustAllRoots(String trustAllRoots); SSLConnectionSocketFactoryBuilder setInputTLS(String inputTLSversion); SSLConnectionSocketFactoryBuilder setKeystore(String keystore); SSLConnectionSocketFactoryBuilder setKeystorePassword(String keystorePassword); SSLConnectionSocketFactoryBuilder setTrustKeystore(String trustKeystore); SSLConnectionSocketFactoryBuilder setTrustPassword(String trustPassword); SSLConnectionSocketFactoryBuilder setallowedCyphers(String allowedCyphers); SSLConnectionSocketFactoryBuilder setX509HostnameVerifier(String x509HostnameVerifier); }
SSLConnectionSocketFactoryBuilder { public SSLConnectionSocketFactory build() { if (!"true".equalsIgnoreCase(trustAllRootsStr) && !"false".equalsIgnoreCase(trustAllRootsStr)) { throw new IllegalArgumentException("'trustAllRoots' can only be 'true' or 'false'"); } boolean trustAllRoots = Boolean.parseBoolean(trustAllRootsStr); SSLContextBuilder sslContextBuilder = SSLContexts.custom(); String changeit = "changeit"; String javaKeystore = System.getProperty("java.home") + "/lib/security/cacerts"; if (!trustAllRoots) { boolean useClientCert = StringUtils.isNotEmpty(keystore); boolean useTrustCert = StringUtils.isNotEmpty(trustKeystore); boolean storeExists = new File(javaKeystore).exists(); if (!useClientCert && storeExists) { keystore = "file:" + javaKeystore; keystorePassword = StringUtils.isNotEmpty(keystorePassword) ? keystorePassword : changeit; useClientCert = true; } else if (useClientCert && !keystore.startsWith("http")) { keystore = "file:" + keystore; } if (!useTrustCert && storeExists) { trustKeystore = "file:" + javaKeystore; trustPassword = StringUtils.isNotEmpty(trustPassword) ? trustPassword : changeit; useTrustCert = true; } else if (useTrustCert && !trustKeystore.startsWith("http")) { trustKeystore = "file:" + trustKeystore; } createTrustKeystore(sslContextBuilder, useTrustCert); createKeystore(sslContextBuilder, useClientCert); } else { try { KeyStore keyStore = createKeyStore(new URL("file:" + keystore), keystorePassword); sslContextBuilder.loadKeyMaterial(keyStore, keystorePassword.toCharArray()); String internalJavaKeystoreUri = "file:" + javaKeystore; KeyStore javaTrustStore = createKeyStore(new URL(internalJavaKeystoreUri), changeit); sslContextBuilder.loadTrustMaterial(javaTrustStore, new TrustSelfSignedStrategy() { @Override public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { return true; } }); } catch (Exception e) { throw new IllegalArgumentException(e.getMessage() + ". " + TRUST_ALL_ROOTS_ERROR + trustAllRoots, e); } } sslContextBuilder.useSSL(); sslContextBuilder.useTLS(); SSLConnectionSocketFactory sslsf = null; try { String x509HostnameVerifierStr = x509HostnameVerifierInputValue.toLowerCase(); X509HostnameVerifier x509HostnameVerifier; switch (x509HostnameVerifierStr) { case "strict": x509HostnameVerifier = SSLConnectionSocketFactory.STRICT_HOSTNAME_VERIFIER; break; case "browser_compatible": x509HostnameVerifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; break; case "allow_all": x509HostnameVerifier = SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER; break; default: throw new IllegalArgumentException("Invalid value '" + x509HostnameVerifierInputValue + "' for input 'x509HostnameVerifier'. Valid values: 'strict','browser_compatible','allow_all'."); } if (!StringUtils.isEmpty(inputTLS)) { Set<String> protocolSet = new HashSet<>(Arrays.asList(inputTLS.trim().split(","))); String[] protocolArray = protocolSet.toArray(new String[0]); if (!checkEquality(protocolArray, SUPPORTED_PROTOCOLS)) { throw new IllegalArgumentException("Protocol not supported"); } if (checkIfTLS2(protocolArray, TLSv12)) flag = true; if (!StringUtils.isEmpty(inputCyphers)) cypherArray = inputCyphers.trim().split(","); if (flag) { if (cypherArray != null) { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), ARRAY_TLSv12, cypherArray, x509HostnameVerifier); } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), protocolArray, null, x509HostnameVerifier); } } else { sslsf = new SSLConnectionSocketFactory(sslContextBuilder.build(), SUPPORTED_PROTOCOLS, null, x509HostnameVerifier); } } catch (Exception e) { if (e instanceof IllegalArgumentException) { throw new IllegalArgumentException(e.getMessage()); } throw new RuntimeException(e.getMessage() + ". " + SSL_CONNECTION_ERROR, e); } return sslsf; }  static boolean checkEquality(String[] subArray, String[] largeArray); static boolean checkIfTLS2(String[] arr, String targetValue); SSLConnectionSocketFactory build(); SSLConnectionSocketFactoryBuilder setTrustAllRoots(String trustAllRoots); SSLConnectionSocketFactoryBuilder setInputTLS(String inputTLSversion); SSLConnectionSocketFactoryBuilder setKeystore(String keystore); SSLConnectionSocketFactoryBuilder setKeystorePassword(String keystorePassword); SSLConnectionSocketFactoryBuilder setTrustKeystore(String trustKeystore); SSLConnectionSocketFactoryBuilder setTrustPassword(String trustPassword); SSLConnectionSocketFactoryBuilder setallowedCyphers(String allowedCyphers); SSLConnectionSocketFactoryBuilder setX509HostnameVerifier(String x509HostnameVerifier); static final String TRUST_ALL_ROOTS_ERROR; static final String SSL_CONNECTION_ERROR; static final String BAD_KEYSTORE_ERROR; static final String INVALID_KEYSTORE_ERROR; static final String BAD_TRUST_KEYSTORE_ERROR; static final String INVALID_TRUST_KEYSTORE_ERROR; static final String SSLv3; static final String TLSv10; static final String TLSv11; static final String TLSv12; static final String[] ARRAY_TLSv12; static final String[] array; static final String[] SUPPORTED_PROTOCOLS; static final String[] SUPPORTED_CYPHERS; public String[] cypherArray; }