类 Platform
java.lang.Object
com.lark.oapi.okhttp.internal.platform.Platform
- 直接已知子类:
ConscryptPlatform
Access to platform-specific features.
Server name indication (SNI)
Supported on Android 2.3+.
Supported on OpenJDK 7+
Session Tickets
Supported on Android 2.3+.
Android Traffic Stats (Socket Tagging)
Supported on Android 4.0+.
ALPN (Application Layer Protocol Negotiation)
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.
Trust Manager Extraction
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.
Android Cleartext Permit Detection
Supported on Android 6.0+ via NetworkSecurityPolicy.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidafterHandshake(SSLSocket sslSocket) Called after the TLS handshake to release resources allocated byconfigureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List<com.lark.oapi.okhttp.Protocol>).alpnProtocolNames(List<Protocol> protocols) buildCertificateChainCleaner(SSLSocketFactory sslSocketFactory) buildCertificateChainCleaner(X509TrustManager trustManager) buildTrustRootIndex(X509TrustManager trustManager) voidconfigureSslSocketFactory(SSLSocketFactory socketFactory) voidconfigureTlsExtensions(SSLSocket sslSocket, String hostname, List<Protocol> protocols) Configure TLS extensions onsslSocketforroute.voidconnectSocket(Socket socket, InetSocketAddress address, int connectTimeout) static Platformget()Prefix used on custom headers.getSelectedProtocol(SSLSocket socket) Returns the negotiated protocol, or null if no protocol was negotiated.getStackTraceForCloseable(String closer) Returns an object that holds a stack trace created at the moment this method is executed.static booleanbooleanisCleartextTrafficPermitted(String hostname) static booleanvoidvoidlogCloseableLeak(String message, Object stackTrace) toString()
-
字段详细资料
-
INFO
public static final int INFO- 另请参阅:
-
WARN
public static final int WARN- 另请参阅:
-
-
构造器详细资料
-
Platform
public Platform()
-
-
方法详细资料
-
get
-
alpnProtocolNames
-
isConscryptPreferred
public static boolean isConscryptPreferred() -
isAndroid
public static boolean isAndroid() -
getPrefix
Prefix used on custom headers. -
configureTlsExtensions
public void configureTlsExtensions(SSLSocket sslSocket, @Nullable String hostname, List<Protocol> protocols) throws IOException Configure TLS extensions onsslSocketforroute.- 参数:
hostname- non-null for client-side handshakes; null for server-side handshakes.- 抛出:
IOException
-
afterHandshake
Called after the TLS handshake to release resources allocated byconfigureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List<com.lark.oapi.okhttp.Protocol>). -
getSelectedProtocol
Returns the negotiated protocol, or null if no protocol was negotiated. -
connectSocket
public void connectSocket(Socket socket, InetSocketAddress address, int connectTimeout) throws IOException - 抛出:
IOException
-
log
-
isCleartextTrafficPermitted
-
getStackTraceForCloseable
Returns an object that holds a stack trace created at the moment this method is executed. This should be used specifically forCloseableobjects and in conjunction withlogCloseableLeak(String, Object). -
logCloseableLeak
-
buildCertificateChainCleaner
-
buildCertificateChainCleaner
-
getSSLContext
-
buildTrustRootIndex
-
configureSslSocketFactory
-
toString
-