public static SSLSocketFactory javaNetSslSocketFactory(LightblueClientConfiguration config) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, UnrecoverableKeyException, KeyManagementException { validateLightblueClientConfigForCertAuth(config); return javaNetSslSocketFactory( CertificateManager.getCaCertFiles(config.getCaFilePaths()), CertificateManager.loadFile(config.getCertFilePath()), config.getCertPassword().toCharArray(), config.getCertAlias(), config.isAcceptSelfSignedCert()); }
/** * @return A default SSL socket factory based on whether or not the * specified * {@link com.redhat.lightblue.client.LightblueClientConfiguration} is * configured to use cert based authentication. */ public static SSLConnectionSocketFactory fromLightblueClientConfig(LightblueClientConfiguration config) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException { if (config.useCertAuth()) { validateLightblueClientConfigForCertAuth(config); return defaultCertAuthSocketFactory( CertificateManager.getCaCertFiles(config.getCaFilePaths()), CertificateManager.loadFile(config.getCertFilePath()), config.getCertPassword().toCharArray(), config.getCertAlias(), config.isAcceptSelfSignedCert()); } return defaultNoAuthSocketFactory(); }