.enabled(sslEnabled) .invalidHostNameAllowed(sslInvalidHostNameAllowed) .context(sslContext) .build(); } catch (MongoInternalException e) {
private static SslSettings buildSSLSettings() { final SSLContext sslContext; try { sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, null, null); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException("No such Algorithm is supported ", e); } catch (KeyManagementException e) { throw new IllegalStateException("KeyManagementException ", e); } return SslSettings.builder() .context(sslContext) .enabled(true) .build(); }
private static SslSettings buildSSLSettings() { final SSLContext sslContext; try { sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, null, null); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException("No such Algorithm is supported ", e); } catch (KeyManagementException e) { throw new IllegalStateException("KeyManagementException ", e); } return SslSettings.builder() .context(sslContext) .enabled(true) .build(); }
keyManagerFactory.init(ks, keyPassword.toCharArray()); ctx.init(keyManagerFactory.getKeyManagers(), null, null); sslBuilder.context(ctx); } catch (Exception e) { logger.error(e.getCause().toString());
.enabled(sslEnabled) .invalidHostNameAllowed(sslInvalidHostNameAllowed) .context(sslContext) .build(); } catch (MongoInternalException e) {