/** * Returns the list of certificates identifying the peer. The peer's * identity certificate is followed by the validated certificate authority * certificates. * <p> * <b>Replaced by:</b> {@link #getPeerCertificates()} * * @return the list of certificates identifying the peer * @throws SSLPeerUnverifiedException * if the identity of the peer has not been verified. */ public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { return session.getPeerCertificateChain(); }
public static X509Certificate[] getCertsFromChannel(Channel channel) { X509Certificate[] certificates = null; ChannelHandler channelHandler = channel.pipeline().get("ssl"); if (channelHandler != null && channelHandler instanceof SslHandler) { SslHandler sslHandler = (SslHandler) channelHandler; try { certificates = sslHandler.engine().getSession().getPeerCertificateChain(); } catch (SSLPeerUnverifiedException e) { // ignore } } return certificates; } }
public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { return unwrap().getPeerCertificateChain(); }
public X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException { if (isSSL()) { ChannelHandlerContext sslHandlerContext = chctx.pipeline().context(SslHandler.class); assert sslHandlerContext != null; SslHandler sslHandler = (SslHandler) sslHandlerContext.handler(); return sslHandler.engine().getSession().getPeerCertificateChain(); } else { return null; } }
@Override public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException, RenegotiationRequiredException { if(unverified != null) { throw unverified; } if(renegotiationRequiredException != null) { throw renegotiationRequiredException; } try { return channel.getSslSession().getPeerCertificateChain(); } catch (SSLPeerUnverifiedException e) { try { SslClientAuthMode sslClientAuthMode = channel.getOption(Options.SSL_CLIENT_AUTH_MODE); if (sslClientAuthMode == SslClientAuthMode.NOT_REQUESTED) { renegotiationRequiredException = RENEGOTIATION_REQUIRED_EXCEPTION; throw renegotiationRequiredException; } } catch (IOException e1) { //ignore, will not actually happen } unverified = PEER_UNVERIFIED_EXCEPTION; throw unverified; } }
@Override public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException, RenegotiationRequiredException { try { return channel.getSslSession().getPeerCertificateChain(); } catch (SSLPeerUnverifiedException e) { try { SslClientAuthMode sslClientAuthMode = channel.getOption(Options.SSL_CLIENT_AUTH_MODE); if (sslClientAuthMode == SslClientAuthMode.NOT_REQUESTED) { throw new RenegotiationRequiredException(); } } catch (IOException e1) { //ignore, will not actually happen } throw e; } } @Override
&& session.getPeerCertificateChain() != null && session.getPeerCertificateChain().length > 0) { peerCert = session.getPeerCertificateChain()[0];
if (session != null) { try { credential = session.getPeerCertificateChain()[0]; log.debug("Using certificate as credential."); } catch (SSLPeerUnverifiedException e) {
&& session.getPeerCertificateChain() != null && session.getPeerCertificateChain().length > 0) { peerCert = session.getPeerCertificateChain()[0];
X509Certificate jsseCerts[] = null; try{ jsseCerts = session.getPeerCertificateChain(); } catch (Throwable ex){
public X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException { if (isSSL()) { ChannelHandlerContext sslHandlerContext = chctx.pipeline().context(SslHandler.class); assert sslHandlerContext != null; SslHandler sslHandler = (SslHandler) sslHandlerContext.handler(); return sslHandler.engine().getSession().getPeerCertificateChain(); } else { return null; } }
jsseCerts = session.getPeerCertificateChain(); } catch(Exception bex) {
/* ... */ public class MyHostnameVerifier extends AbstractVerifier { boolean verify(String hostname, SSLSession session) { X509Certificate[] chain = session.getPeerCertificateChain(); /* made some checks... */ return checked; } } sslSocketFactory.setHostnameVerifier(new MyHostnameVerifier());
void enableEncryption(String ssl) throws IOException { Logger.println("Enabling TLS encryption"); SocketFactory sf = SocketFactories.getSocketFactory(ssl, socket); sslSocket = sf.createSocket(getHost(), getPort()); SSLSocket s = (SSLSocket) sslSocket; s.startHandshake(); setX509Certificates(s.getSession().getPeerCertificateChain()); setOut(new DataOutputStream(sslSocket.getOutputStream())); setIn(new DataInputStream(sslSocket.getInputStream())); }
@Override public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { return unwrap().getPeerCertificateChain(); }
@Override public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { return unwrap().getPeerCertificateChain(); }
@Override public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { return delegate().getPeerCertificateChain(); }
public static X509Certificate[] getCertsFromChannel(Channel channel) { X509Certificate[] certificates = null; ChannelHandler channelHandler = channel.pipeline().get("ssl"); if (channelHandler != null && channelHandler instanceof SslHandler) { SslHandler sslHandler = (SslHandler) channelHandler; try { certificates = sslHandler.engine().getSession().getPeerCertificateChain(); } catch (SSLPeerUnverifiedException e) { // ignore } } return certificates; } }
public static X509Certificate[] getCertsFromChannel(Channel channel) { X509Certificate[] certificates = null; ChannelHandler channelHandler = channel.pipeline().get("ssl"); if (channelHandler != null && channelHandler instanceof SslHandler) { SslHandler sslHandler = (SslHandler) channelHandler; try { certificates = sslHandler.engine().getSession().getPeerCertificateChain(); } catch (SSLPeerUnverifiedException e) { // ignore } } return certificates; } }
public static X509Certificate[] getCertsFromChannel(Channel channel) { X509Certificate[] certificates = null; ChannelHandler channelHandler = channel.pipeline().get("ssl"); if (channelHandler != null && channelHandler instanceof SslHandler) { SslHandler sslHandler = (SslHandler) channelHandler; try { certificates = sslHandler.engine().getSession().getPeerCertificateChain(); } catch (SSLPeerUnverifiedException e) { // ignore } } return certificates; } }