public class Platform extends Object
Supported on Android 2.3+.
Supported on OpenJDK 7+
Supported on Android 2.3+.
Supported on Android 4.0+.
Supported on Android 5.0+. The APIs were present in Android 4.4, but that implementation was unstable.
Supported on OpenJDK 8 via the JettyALPN-boot library.
Supported on OpenJDK 9+ via SSLParameters and SSLSocket features.
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.
Supported on Android 6.0+ via NetworkSecurityPolicy.
| 构造器和说明 |
|---|
Platform() |
public static Platform get()
public static boolean isConscryptPreferred()
public static boolean isAndroid()
public String getPrefix()
public void configureTlsExtensions(SSLSocket sslSocket, @Nullable String hostname, List<Protocol> protocols) throws IOException
sslSocket for route.hostname - non-null for client-side handshakes; null for server-side handshakes.IOExceptionpublic void afterHandshake(SSLSocket sslSocket)
configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List<com.lark.oapi.okhttp.Protocol>).@Nullable public String getSelectedProtocol(SSLSocket socket)
public void connectSocket(Socket socket, InetSocketAddress address, int connectTimeout) throws IOException
IOExceptionpublic boolean isCleartextTrafficPermitted(String hostname)
@Nullable public Object getStackTraceForCloseable(String closer)
Closeable objects and in conjunction with
logCloseableLeak(String, Object).public CertificateChainCleaner buildCertificateChainCleaner(X509TrustManager trustManager)
public CertificateChainCleaner buildCertificateChainCleaner(SSLSocketFactory sslSocketFactory)
public SSLContext getSSLContext()
public TrustRootIndex buildTrustRootIndex(X509TrustManager trustManager)
public void configureSslSocketFactory(SSLSocketFactory socketFactory)
Copyright © 2024. All rights reserved.