/** * Returns the list of local certificates used during the handshake. These * certificates were sent to the peer. * * @return Returns the list of certificates used during the handshake with * the local identity certificate followed by CAs, or {@code null} * if no certificates were used during the handshake. */ public Certificate[] getLocalCertificates() { return session.getLocalCertificates(); }
@Override public Certificate[] getLocalCertificates() { if (tlsStreamHandler != null) { return tlsStreamHandler.getSSLSession().getLocalCertificates(); } return new Certificate[0]; }
@Override public Certificate[] getLocalCertificates() { SSLSession sslSession = (SSLSession) ioSession.getAttribute(SslFilter.SSL_SESSION); if (sslSession != null) { return sslSession.getLocalCertificates(); } return new Certificate[0]; }
public static Handshake get(SSLSession session) throws IOException { String cipherSuiteString = session.getCipherSuite(); if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null"); if ("SSL_NULL_WITH_NULL_NULL".equals(cipherSuiteString)) { throw new IOException("cipherSuite == SSL_NULL_WITH_NULL_NULL"); } CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString); String tlsVersionString = session.getProtocol(); if (tlsVersionString == null) throw new IllegalStateException("tlsVersion == null"); if ("NONE".equals(tlsVersionString)) throw new IOException("tlsVersion == NONE"); TlsVersion tlsVersion = TlsVersion.forJavaName(tlsVersionString); Certificate[] peerCertificates; try { peerCertificates = session.getPeerCertificates(); } catch (SSLPeerUnverifiedException ignored) { peerCertificates = null; } List<Certificate> peerCertificatesList = peerCertificates != null ? Util.immutableList(peerCertificates) : Collections.emptyList(); Certificate[] localCertificates = session.getLocalCertificates(); List<Certificate> localCertificatesList = localCertificates != null ? Util.immutableList(localCertificates) : Collections.emptyList(); return new Handshake(tlsVersion, cipherSuite, peerCertificatesList, localCertificatesList); }
public Certificate[] getLocalCertificates() { return unwrap().getLocalCertificates(); }
public static Handshake get(SSLSession session) { String cipherSuiteString = session.getCipherSuite(); if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null"); CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString); String tlsVersionString = session.getProtocol(); if (tlsVersionString == null) throw new IllegalStateException("tlsVersion == null"); TlsVersion tlsVersion = TlsVersion.forJavaName(tlsVersionString); Certificate[] peerCertificates; try { peerCertificates = session.getPeerCertificates(); } catch (SSLPeerUnverifiedException ignored) { peerCertificates = null; } List<Certificate> peerCertificatesList = peerCertificates != null ? Util.immutableList(peerCertificates) : Collections.<Certificate>emptyList(); Certificate[] localCertificates = session.getLocalCertificates(); List<Certificate> localCertificatesList = localCertificates != null ? Util.immutableList(localCertificates) : Collections.<Certificate>emptyList(); return new Handshake(tlsVersion, cipherSuite, peerCertificatesList, localCertificatesList); }
public static Handshake get(SSLSession session) throws IOException { String cipherSuiteString = session.getCipherSuite(); if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null"); if ("SSL_NULL_WITH_NULL_NULL".equals(cipherSuiteString)) { throw new IOException("cipherSuite == SSL_NULL_WITH_NULL_NULL"); } CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString); String tlsVersionString = session.getProtocol(); if (tlsVersionString == null) throw new IllegalStateException("tlsVersion == null"); if ("NONE".equals(tlsVersionString)) throw new IOException("tlsVersion == NONE"); TlsVersion tlsVersion = TlsVersion.forJavaName(tlsVersionString); Certificate[] peerCertificates; try { peerCertificates = session.getPeerCertificates(); } catch (SSLPeerUnverifiedException ignored) { peerCertificates = null; } List<Certificate> peerCertificatesList = peerCertificates != null ? Util.immutableList(peerCertificates) : Collections.emptyList(); Certificate[] localCertificates = session.getLocalCertificates(); List<Certificate> localCertificatesList = localCertificates != null ? Util.immutableList(localCertificates) : Collections.emptyList(); return new Handshake(tlsVersion, cipherSuite, peerCertificatesList, localCertificatesList); }
peerCert = session.getPeerCertificateChain()[0]; if (session.getLocalCertificates() != null && session.getLocalCertificates().length > 0) { serverCert = session.getLocalCertificates()[0];
final Certificate[] localCertificates = session.getLocalCertificates(); serverCert = localCertificates != null && localCertificates.length > 0 ? (X509Certificate) localCertificates[0] : null;
peerCert = session.getPeerCertificateChain()[0]; if (session.getLocalCertificates() != null && session.getLocalCertificates().length > 0) { serverCert = session.getLocalCertificates()[0];
/** * Returns the list of local certificates used during the handshake. These * certificates were sent to the peer. * * @return Returns the list of certificates used during the handshake with * the local identity certificate followed by CAs, or {@code null} * if no certificates were used during the handshake. */ public Certificate[] getLocalCertificates() { return session.getLocalCertificates(); }
/** * Returns the list of local certificates used during the handshake. These * certificates were sent to the peer. * * @return Returns the list of certificates used during the handshake with * the local identity certificate followed by CAs, or {@code null} * if no certificates were used during the handshake. */ public Certificate[] getLocalCertificates() { return session.getLocalCertificates(); }
/** * Returns the list of local certificates used during the handshake. These * certificates were sent to the peer. * * @return Returns the list of certificates used during the handshake with * the local identity certificate followed by CAs, or {@code null} * if no certificates were used during the handshake. */ public Certificate[] getLocalCertificates() { return session.getLocalCertificates(); }
/** * Returns the list of local certificates used during the handshake. These * certificates were sent to the peer. * * @return Returns the list of certificates used during the handshake with * the local identity certificate followed by CAs, or {@code null} * if no certificates were used during the handshake. */ public Certificate[] getLocalCertificates() { return session.getLocalCertificates(); }
@Override public Certificate[] getLocalCertificates() { SSLSession sslSession = (SSLSession) ioSession.getAttribute(SslFilter.SSL_SESSION); if (sslSession != null) { return sslSession.getLocalCertificates(); } return new Certificate[0]; }
@Override public Certificate[] getLocalCertificates() { return delegate().getLocalCertificates(); }
@Override public Certificate[] getLocalCertificates() { SecureCacheResponse cacheResponse = delegate.getSecureCacheResponse(); if (cacheResponse != null) { List<Certificate> result = cacheResponse.getLocalCertificateChain(); return result != null ? result.toArray(new Certificate[result.size()]) : null; } SSLSocket sslSocket = getSslSocket(); if (sslSocket != null) { return sslSocket.getSession().getLocalCertificates(); } return null; }
@Override public Certificate[] getLocalCertificates() { SecureCacheResponse cacheResponse = delegate.getSecureCacheResponse(); if (cacheResponse != null) { List<Certificate> result = cacheResponse.getLocalCertificateChain(); return result != null ? result.toArray(new Certificate[result.size()]) : null; } SSLSocket sslSocket = getSslSocket(); if (sslSocket != null) { return sslSocket.getSession().getLocalCertificates(); } return null; }
@Override public Certificate[] getLocalCertificates() { SecureCacheResponse cacheResponse = delegate.getCacheResponse(); if (cacheResponse != null) { List<Certificate> result = cacheResponse.getLocalCertificateChain(); return result != null ? result.toArray(new Certificate[result.size()]) : null; } checkConnected(); return delegate.getSSLSocket().getSession().getLocalCertificates(); }
private X509Certificate getServerCertificate(final Request request) { // return the active server certificate, which is used for this connection. final SSLEngine sslEngine = SSLUtils.getSSLEngine( request.getContext().getConnection()); return (X509Certificate) sslEngine.getSession().getLocalCertificates()[0]; } }