Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -12738,9 +12738,11 @@ package android.net { method public static javax.net.ssl.SSLSocketFactory getInsecure(int, android.net.SSLSessionCache); method public byte[] getNpnSelectedProtocol(java.net.Socket); method public java.lang.String[] getSupportedCipherSuites(); method public void setHostname(java.net.Socket, java.lang.String); method public void setKeyManagers(javax.net.ssl.KeyManager[]); method public void setNpnProtocols(byte[][]); method public void setTrustManagers(javax.net.ssl.TrustManager[]); method public void setUseSessionTickets(java.net.Socket, boolean); } public final class SSLSessionCache { core/java/android/net/SSLCertificateSocketFactory.java +34 −1 Original line number Diff line number Diff line Loading @@ -300,9 +300,10 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { * null if no protocol was negotiated. * * @param socket a socket created by this factory. * @throws IllegalArgumentException if the socket was not created by this factory. */ public byte[] getNpnSelectedProtocol(Socket socket) { return ((OpenSSLSocketImpl) socket).getNpnSelectedProtocol(); return castToOpenSSLSocket(socket).getNpnSelectedProtocol(); } /** Loading @@ -316,6 +317,38 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { mInsecureFactory = null; } /** * Enables <a href="http://tools.ietf.org/html/rfc5077#section-3.2">session ticket</a> * support on the given socket. * * @param socket a socket created by this factory * @param useSessionTickets {@code true} to enable session ticket support on this socket. * @throws IllegalArgumentException if the socket was not created by this factory. */ public void setUseSessionTickets(Socket socket, boolean useSessionTickets) { castToOpenSSLSocket(socket).setUseSessionTickets(useSessionTickets); } /** * Turns on <a href="http://tools.ietf.org/html/rfc6066#section-3">Server * Name Indication (SNI)</a> on a given socket. * * @param socket a socket created by this factory. * @param hostName the desired SNI hostname, null to disable. * @throws IllegalArgumentException if the socket was not created by this factory. */ public void setHostname(Socket socket, String hostName) { castToOpenSSLSocket(socket).setHostname(hostName); } private static OpenSSLSocketImpl castToOpenSSLSocket(Socket socket) { if (!(socket instanceof OpenSSLSocketImpl)) { throw new IllegalArgumentException("Socket not created by this factory: " + socket); } return (OpenSSLSocketImpl) socket; } /** * {@inheritDoc} Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -12738,9 +12738,11 @@ package android.net { method public static javax.net.ssl.SSLSocketFactory getInsecure(int, android.net.SSLSessionCache); method public byte[] getNpnSelectedProtocol(java.net.Socket); method public java.lang.String[] getSupportedCipherSuites(); method public void setHostname(java.net.Socket, java.lang.String); method public void setKeyManagers(javax.net.ssl.KeyManager[]); method public void setNpnProtocols(byte[][]); method public void setTrustManagers(javax.net.ssl.TrustManager[]); method public void setUseSessionTickets(java.net.Socket, boolean); } public final class SSLSessionCache {
core/java/android/net/SSLCertificateSocketFactory.java +34 −1 Original line number Diff line number Diff line Loading @@ -300,9 +300,10 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { * null if no protocol was negotiated. * * @param socket a socket created by this factory. * @throws IllegalArgumentException if the socket was not created by this factory. */ public byte[] getNpnSelectedProtocol(Socket socket) { return ((OpenSSLSocketImpl) socket).getNpnSelectedProtocol(); return castToOpenSSLSocket(socket).getNpnSelectedProtocol(); } /** Loading @@ -316,6 +317,38 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { mInsecureFactory = null; } /** * Enables <a href="http://tools.ietf.org/html/rfc5077#section-3.2">session ticket</a> * support on the given socket. * * @param socket a socket created by this factory * @param useSessionTickets {@code true} to enable session ticket support on this socket. * @throws IllegalArgumentException if the socket was not created by this factory. */ public void setUseSessionTickets(Socket socket, boolean useSessionTickets) { castToOpenSSLSocket(socket).setUseSessionTickets(useSessionTickets); } /** * Turns on <a href="http://tools.ietf.org/html/rfc6066#section-3">Server * Name Indication (SNI)</a> on a given socket. * * @param socket a socket created by this factory. * @param hostName the desired SNI hostname, null to disable. * @throws IllegalArgumentException if the socket was not created by this factory. */ public void setHostname(Socket socket, String hostName) { castToOpenSSLSocket(socket).setHostname(hostName); } private static OpenSSLSocketImpl castToOpenSSLSocket(Socket socket) { if (!(socket instanceof OpenSSLSocketImpl)) { throw new IllegalArgumentException("Socket not created by this factory: " + socket); } return (OpenSSLSocketImpl) socket; } /** * {@inheritDoc} Loading