From 37f59248b7bd5083ad822333d191904e47a809cf Mon Sep 17 00:00:00 2001 From: Evan Nelson Date: Tue, 14 May 2024 16:23:34 -0700 Subject: [PATCH] apiDump --- mockwebserver-deprecated/api/mockwebserver.api | 6 +++--- mockwebserver/api/mockwebserver3.api | 8 ++++---- okhttp/api/okhttp.api | 1 + okhttp/src/main/kotlin/okhttp3/ConnectionSpec.kt | 14 +++++++++++++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/mockwebserver-deprecated/api/mockwebserver.api b/mockwebserver-deprecated/api/mockwebserver.api index 895e7be137c9..397e3f7d0326 100644 --- a/mockwebserver-deprecated/api/mockwebserver.api +++ b/mockwebserver-deprecated/api/mockwebserver.api @@ -69,7 +69,7 @@ public final class okhttp3/mockwebserver/MockWebServer : org/junit/rules/Externa public final fun -deprecated_protocols ()Ljava/util/List; public final fun -deprecated_protocols (Ljava/util/List;)V public final fun -deprecated_requestCount ()I - public final fun -deprecated_serverSocketFactory (Ljavax/net/ServerSocketFactory;)V + public final fun -deprecated_serverSocketFactory (Lokhttp3/internal/socket/OkioServerSocketFactory;)V public fun ()V public fun close ()V public final fun enqueue (Lokhttp3/mockwebserver/MockResponse;)V @@ -80,7 +80,7 @@ public final class okhttp3/mockwebserver/MockWebServer : org/junit/rules/Externa public final fun getPort ()I public final fun getProtocolNegotiationEnabled ()Z public final fun getRequestCount ()I - public final fun getServerSocketFactory ()Ljavax/net/ServerSocketFactory; + public final fun getServerSocketFactory ()Lokhttp3/internal/socket/OkioServerSocketFactory; public final fun noClientAuth ()V public final fun protocols ()Ljava/util/List; public final fun requestClientAuth ()V @@ -89,7 +89,7 @@ public final class okhttp3/mockwebserver/MockWebServer : org/junit/rules/Externa public final fun setDispatcher (Lokhttp3/mockwebserver/Dispatcher;)V public final fun setProtocolNegotiationEnabled (Z)V public final fun setProtocols (Ljava/util/List;)V - public final fun setServerSocketFactory (Ljavax/net/ServerSocketFactory;)V + public final fun setServerSocketFactory (Lokhttp3/internal/socket/OkioServerSocketFactory;)V public final fun shutdown ()V public final fun start ()V public final fun start (I)V diff --git a/mockwebserver/api/mockwebserver3.api b/mockwebserver/api/mockwebserver3.api index 0f4410a496e8..76fa5cd00518 100644 --- a/mockwebserver/api/mockwebserver3.api +++ b/mockwebserver/api/mockwebserver3.api @@ -107,7 +107,7 @@ public final class mockwebserver3/MockWebServer : java/io/Closeable { public final fun getProtocolNegotiationEnabled ()Z public final fun getProtocols ()Ljava/util/List; public final fun getRequestCount ()I - public final fun getServerSocketFactory ()Ljavax/net/ServerSocketFactory; + public final fun getServerSocketFactory ()Lokhttp3/internal/socket/OkioServerSocketFactory; public final fun getStarted ()Z public final fun noClientAuth ()V public final fun requestClientAuth ()V @@ -116,7 +116,7 @@ public final class mockwebserver3/MockWebServer : java/io/Closeable { public final fun setDispatcher (Lmockwebserver3/Dispatcher;)V public final fun setProtocolNegotiationEnabled (Z)V public final fun setProtocols (Ljava/util/List;)V - public final fun setServerSocketFactory (Ljavax/net/ServerSocketFactory;)V + public final fun setServerSocketFactory (Lokhttp3/internal/socket/OkioServerSocketFactory;)V public final fun setStarted (Z)V public final fun shutdown ()V public final fun start ()V @@ -159,8 +159,8 @@ public final class mockwebserver3/QueueDispatcher$Companion { } public final class mockwebserver3/RecordedRequest { - public fun (Ljava/lang/String;Lokhttp3/Headers;Ljava/util/List;JLokio/Buffer;ILjava/net/Socket;Ljava/io/IOException;)V - public synthetic fun (Ljava/lang/String;Lokhttp3/Headers;Ljava/util/List;JLokio/Buffer;ILjava/net/Socket;Ljava/io/IOException;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/lang/String;Lokhttp3/Headers;Ljava/util/List;JLokio/Buffer;ILokhttp3/internal/socket/OkioSocket;Ljava/io/IOException;)V + public synthetic fun (Ljava/lang/String;Lokhttp3/Headers;Ljava/util/List;JLokio/Buffer;ILokhttp3/internal/socket/OkioSocket;Ljava/io/IOException;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun getBody ()Lokio/Buffer; public final fun getBodySize ()J public final fun getChunkSizes ()Ljava/util/List; diff --git a/okhttp/api/okhttp.api b/okhttp/api/okhttp.api index fcc0709091a4..88fd66fe822e 100644 --- a/okhttp/api/okhttp.api +++ b/okhttp/api/okhttp.api @@ -409,6 +409,7 @@ public final class okhttp3/ConnectionSpec { public fun equals (Ljava/lang/Object;)Z public fun hashCode ()I public final fun isCompatible (Ljavax/net/ssl/SSLSocket;)Z + public final fun isCompatible (Lokhttp3/internal/socket/OkioSslSocket;)Z public final fun isTls ()Z public final fun supportsTlsExtensions ()Z public final fun tlsVersions ()Ljava/util/List; diff --git a/okhttp/src/main/kotlin/okhttp3/ConnectionSpec.kt b/okhttp/src/main/kotlin/okhttp3/ConnectionSpec.kt index df2d6a77bf26..cb66e2b5f2eb 100644 --- a/okhttp/src/main/kotlin/okhttp3/ConnectionSpec.kt +++ b/okhttp/src/main/kotlin/okhttp3/ConnectionSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Square, Inc. + * Copyright (C) 2024 Square, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -168,10 +168,22 @@ class ConnectionSpec internal constructor( * For protocols, at least one of the [required protocols][tlsVersions] must match the socket's * enabled protocols. */ + @ExperimentalOkHttpApi fun isCompatible(socket: OkioSslSocket): Boolean { return isCompatible((socket as RealOkioSslSocket).delegate) } + /** + * Returns `true` if the socket, as currently configured, supports this connection spec. In + * order for a socket to be compatible the enabled cipher suites and protocols must intersect. + * + * For cipher suites, at least one of the [required cipher suites][cipherSuites] must match the + * socket's enabled cipher suites. If there are no required cipher suites the socket must have at + * least one cipher suite enabled. + * + * For protocols, at least one of the [required protocols][tlsVersions] must match the socket's + * enabled protocols. + */ fun isCompatible(socket: SSLSocket): Boolean { if (!isTls) { return false