public SlackSender() { try { sslCtx = SslContext.newClientContext(InsecureTrustManagerFactory.INSTANCE); bootstrap.group(group) .channel(Epoll.isAvailable() ? EpollSocketChannel.class : NioSocketChannel.class) .option(ChannelOption.TCP_NODELAY, true) .option(ChannelOption.SO_KEEPALIVE, true); } catch (SSLException e) { e.printStackTrace(); } }
/** * Verifies that the certificate matches the specified hostname. * Uses the {@link DefaultHostnameVerifier} from the Apache HttpClient library * to confirm that the hostname matches the certificate. * * @param hostname * @param leafCert * @return */ private static boolean verifyHostname(String hostname, X509Certificate leafCert) { try { // Check that the hostname matches the certificate. This method throws an exception if // the cert could not be verified. HOSTNAME_VERIFIER.verify(hostname, leafCert); return true; } catch (SSLException e) { e.printStackTrace(); } return false; }
/** * Verifies that the certificate matches the specified hostname. Uses the * {@link DefaultHostnameVerifier} from the Apache HttpClient library to confirm * that the hostname matches the certificate. * * @param hostname * @param leafCert * @return */ private static boolean verifyHostname(String hostname, X509Certificate leafCert) { try { // Check that the hostname matches the certificate. This method throws an // exception if // the cert could not be verified. HOSTNAME_VERIFIER.verify(hostname, leafCert); return true; } catch (SSLException e) { e.printStackTrace(); } return false; }
@Override public void run() { try { start(); } catch (CertificateException e) { e.printStackTrace(); } catch (SSLException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } }
@Override public void run() { try { start(); } catch (CertificateException e) { e.printStackTrace(); } catch (SSLException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } }
@Override public void run() { try { start(); } catch (CertificateException e) { e.printStackTrace(); } catch (SSLException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } }
public NettyHttpClient(String authCode, HttpProxy proxy, ClientConfig config) { _maxRetryTimes = config.getMaxRetryTimes(); _readTimeout = config.getReadTimeout(); String message = MessageFormat.format("Created instance with " + "connectionTimeout {0}, readTimeout {1}, maxRetryTimes {2}, SSL Version {3}", config.getConnectionTimeout(), _readTimeout, _maxRetryTimes, config.getSSLVersion()); LOG.debug(message); _authCode = authCode; try { _sslCtx = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build(); _workerGroup = new NioEventLoopGroup(); b = new Bootstrap(); // (1) b.group(_workerGroup); // (2) b.channel(NioSocketChannel.class); // (3) b.option(ChannelOption.SO_KEEPALIVE, true); // (4) } catch (SSLException e) { e.printStackTrace(); } }
e.printStackTrace(); try { responseList.add(new JSONObject("{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-40,\"message\":\"" + e.getLocalizedMessage() + "\"},\"id\":null}"));
} catch (SSLException e) { System.out.println(); e.printStackTrace(System.out);
} catch (SSLException e) { System.out.println(); e.printStackTrace(System.out);
e.printStackTrace(System.out);
result = engine.unwrap( peerNetData, peerAppData ); } catch ( SSLException e ) { e.printStackTrace(); throw e;
private void createChannel(){ SslContext sslContext = null; try { String filePath = SimpleServerStart.class.getClassLoader().getResource("").getPath(); File certChain = new File(filePath.concat("server1-public-ca.pem")); sslContext = GrpcSslContexts.forClient() .sslProvider(SslProvider.OPENSSL) .trustManager(certChain) .build(); } catch (SSLException e) { e.printStackTrace(); } //Mind :this the set host=waterzooi.test.google.be ,cause CA defined, // so C:\Windows\System32\drivers\etc\hosts append 127.0.0.1 waterzooi.test.google.be managedChannel = NettyChannelBuilder.forAddress("waterzooi.test.google.be",PORT) .negotiationType(NegotiationType.TLS) .sslContext(sslContext).build(); }
result = engine.unwrap( peerNetData, peerAppData ); } catch ( SSLException e ) { e.printStackTrace(); throw e;
result = engine.unwrap( peerNetData, peerAppData ); } catch ( SSLException e ) { e.printStackTrace(); throw e;
private void buildSslContext() { SslProvider provider = OpenSsl.isAvailable() ? SslProvider.OPENSSL : SslProvider.JDK; try { sslContext = SslContextBuilder.forClient() .sslProvider(provider) /* NOTE: the cipher filter may not include all ciphers required by the HTTP/2 specification. * Please refer to the HTTP/2 specification for cipher requirements. */ .ciphers(Http2SecurityUtil.CIPHERS, SupportedCipherSuiteFilter.INSTANCE) .trustManager(InsecureTrustManagerFactory.INSTANCE) .build(); } catch (SSLException e) { e.printStackTrace(); } }
e.printStackTrace(); throw new NotReachableException(e.getMessage()); } else {
e.printStackTrace(); throw new NotReachableException(e.getMessage()); } else {
e.printStackTrace(); handler.error(e, this); return;
} catch (SSLException e) { System.out.println(); e.printStackTrace(System.out);