Handler<NetSocket> serverHandler = socket -> { indicatedServerName = socket.indicatedServerName(); if (socket.isSsl()) { certificateChainChecker.accept(socket); if (upgradedServer.compareAndSet(false, true)) { indicatedServerName = socket.indicatedServerName(); assertFalse(socket.isSsl()); socket.exceptionHandler(err -> { if (shouldPass) { certificateChainChecker.accept(socket); upgradedServerCount.incrementAndGet(); assertTrue(socket.isSsl()); }); } else { assertTrue(socket.isSsl()); assertEquals(1, upgradedServerCount.get()); assertTrue(socket.isSsl()); if (socket.isSsl()) { try { clientPeerCert = socket.peerCertificateChain()[0]; assertFalse(socket.isSsl()); Handler<Void> handler = v -> { assertTrue(socket.isSsl()); try {
/** * @return true if this {@link io.vertx.rxjava.core.net.NetSocket} is encrypted via SSL/TLS. */ public boolean isSsl() { boolean ret = delegate.isSsl(); return ret; }
/** * @return true if this {@link io.vertx.rxjava.core.net.NetSocket} is encrypted via SSL/TLS. */ public boolean isSsl() { boolean ret = delegate.isSsl(); return ret; }
Handler<NetSocket> serverHandler = socket -> { indicatedServerName = socket.indicatedServerName(); if (socket.isSsl()) { certificateChainChecker.accept(socket); if (upgradedServer.compareAndSet(false, true)) { indicatedServerName = socket.indicatedServerName(); assertFalse(socket.isSsl()); socket.exceptionHandler(err -> { if (shouldPass) { certificateChainChecker.accept(socket); upgradedServerCount.incrementAndGet(); assertTrue(socket.isSsl()); }); } else { assertTrue(socket.isSsl()); assertEquals(1, upgradedServerCount.get()); assertTrue(socket.isSsl()); if (socket.isSsl()) { try { clientPeerCert = socket.peerCertificateChain()[0]; assertFalse(socket.isSsl()); Handler<Void> handler = v -> { assertTrue(socket.isSsl()); try {
@Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { LOG.debug("initializing SASL authenticator"); this.protonConnection = protonConnection; this.sasl = transport.sasl(); sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(AuthenticationConstants.MECHANISM_PLAIN, AuthenticationConstants.MECHANISM_EXTERNAL); if (socket.isSsl()) { LOG.trace("Client connected through a secured port"); try { peerCertificateChain = socket.sslSession().getPeerCertificates(); } catch (SSLPeerUnverifiedException e) { LOG.debug("Device's Identity cannot be verified: " + e.getMessage()); } } }
@Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { LOG.debug("initializing SASL authenticator"); this.protonConnection = protonConnection; this.sasl = transport.sasl(); // TODO determine supported mechanisms dynamically based on registered AuthenticationService implementations sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(MECHANISM_EXTERNAL, MECHANISM_PLAIN); if (socket.isSsl()) { LOG.debug("client connected using TLS, extracting client certificate chain"); try { peerCertificateChain = socket.peerCertificateChain(); LOG.debug("found valid client certificate DN [{}]", peerCertificateChain[0].getSubjectDN()); } catch (final SSLPeerUnverifiedException e) { LOG.debug("could not extract client certificate chain, maybe TLS based client auth is not required"); } } }
@Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { LOG.debug("initializing SASL authenticator"); this.protonConnection = protonConnection; this.sasl = transport.sasl(); // TODO determine supported mechanisms dynamically based on registered AuthenticationService implementations sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(MECHANISM_EXTERNAL, MECHANISM_PLAIN); if (socket.isSsl()) { LOG.debug("client connected using TLS, extracting client certificate chain"); try { peerCertificateChain = socket.peerCertificateChain(); LOG.debug("found valid client certificate DN [{}]", peerCertificateChain[0].getSubjectDN()); } catch (final SSLPeerUnverifiedException e) { LOG.debug("could not extract client certificate chain, maybe TLS based client auth is not required"); } } }
@Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { LOG.debug("initializing SASL authenticator"); this.protonConnection = protonConnection; this.sasl = transport.sasl(); // TODO determine supported mechanisms dynamically based on registered AuthenticationService implementations sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(MECHANISM_EXTERNAL, MECHANISM_PLAIN); if (socket.isSsl()) { LOG.debug("client connected using TLS, extracting client certificate chain"); try { peerCertificateChain = socket.peerCertificateChain(); LOG.debug("found valid client certificate DN [{}]", peerCertificateChain[0].getSubjectDN()); } catch (SSLPeerUnverifiedException e) { LOG.debug("could not extract client certificate chain, maybe TLS based client auth is not required"); } } }
if (be.socket().isSsl()) { try { for (X509Certificate c : be.socket().peerCertificateChain()) {
if (be.socket().isSsl()) { try { for (X509Certificate c : be.socket().peerCertificateChain()) {