public class Platform extends Object
ALPN (Application Layer Protocol Negotiation) first arrived in Android 4.4, ALPN is supported on OpenJDK 7 and 8 (via the Jetty ALPN-boot library).
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 |
logW(String warning) |
void |
tagSocket(Socket socket) |
URI |
toUriLenient(URL url) |
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 URI toUriLenient(URL url) throws URISyntaxException
URISyntaxException
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
Copyright © 2015. All rights reserved.