public class Platform extends Object
Supported on Android 2.3+ and OpenJDK 7+. There are no public APIs to recover the trust
manager that was used to create an SSLSocketFactory
.
Constructor and Description |
---|
Platform() |
Modifier and Type | Method and Description |
---|---|
void |
afterHandshake(SSLSocket sslSocket)
Called after the TLS handshake to release resources allocated by
configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List<com.squareup.okhttp.Protocol>) . |
void |
configureTlsExtensions(SSLSocket sslSocket,
String hostname,
List<Protocol> protocols)
Configure TLS extensions on
sslSocket for route . |
void |
connectSocket(Socket socket,
InetSocketAddress address,
int connectTimeout) |
static Platform |
get() |
String |
getPrefix()
Prefix used on custom headers.
|
String |
getSelectedProtocol(SSLSocket socket)
Returns the negotiated protocol, or null if no protocol was negotiated.
|
void |
log(String message) |
void |
logW(String warning) |
void |
tagSocket(Socket socket) |
X509TrustManager |
trustManager(SSLSocketFactory sslSocketFactory) |
TrustRootIndex |
trustRootIndex(X509TrustManager trustManager) |
void |
untagSocket(Socket socket) |
public static Platform get()
public String getPrefix()
public void logW(String warning)
public void tagSocket(Socket socket) throws SocketException
SocketException
public void untagSocket(Socket socket) throws SocketException
SocketException
public X509TrustManager trustManager(SSLSocketFactory sslSocketFactory)
public TrustRootIndex trustRootIndex(X509TrustManager trustManager)
public void configureTlsExtensions(SSLSocket sslSocket, String hostname, List<Protocol> protocols)
sslSocket
for route
.hostname
- non-null for client-side handshakes; null for
server-side handshakes.public void afterHandshake(SSLSocket sslSocket)
configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List<com.squareup.okhttp.Protocol>)
.public String getSelectedProtocol(SSLSocket socket)
public void connectSocket(Socket socket, InetSocketAddress address, int connectTimeout) throws IOException
IOException
public void log(String message)
Copyright © 2016. All rights reserved.