mirror of
https://github.com/square/okhttp.git
synced 2025-08-01 16:06:56 +03:00
Build with 3 JDK targets (#4568)
* Build with 3 targets * Update maven * remove jdk 12 ea * Try without errorprone temporarily * Still set 1.8 * javadoc tolerance * Profiles for 10 + 11 * More tolerant * JDK 11 test skipping * Cleanup imports * Link to github issues * Support JDK 12 building
This commit is contained in:
committed by
Jesse Wilson
parent
933bb401e8
commit
50df11c471
@ -31,6 +31,9 @@ import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static okhttp3.Protocol.HTTP_1_1;
|
||||
import static okhttp3.Protocol.HTTP_2;
|
||||
import static okhttp3.tls.internal.TlsUtil.localhost;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.fail;
|
||||
@ -143,8 +146,8 @@ public final class LoggingEventListenerTest {
|
||||
.assertLogMatch("connectStart: " + url.host() + "/.+ DIRECT")
|
||||
.assertLogMatch("secureConnectStart")
|
||||
.assertLogMatch("secureConnectEnd: Handshake\\{"
|
||||
+ "tlsVersion=TLS_1_2 "
|
||||
+ "cipherSuite=TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 "
|
||||
+ "tlsVersion=TLS_1_[23] "
|
||||
+ "cipherSuite=(?:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384|TLS_AES_128_GCM_SHA256) "
|
||||
+ "peerCertificates=\\[CN=localhost\\] "
|
||||
+ "localCertificates=\\[\\]}")
|
||||
.assertLogMatch("connectEnd: h2")
|
||||
@ -189,6 +192,7 @@ public final class LoggingEventListenerTest {
|
||||
@Test
|
||||
public void connectFail() {
|
||||
server.useHttps(handshakeCertificates.sslSocketFactory(), false);
|
||||
server.setProtocols(asList(HTTP_2, HTTP_1_1));
|
||||
server.enqueue(new MockResponse().setSocketPolicy(SocketPolicy.FAIL_HANDSHAKE));
|
||||
url = server.url("/");
|
||||
|
||||
@ -205,9 +209,9 @@ public final class LoggingEventListenerTest {
|
||||
.assertLogMatch("connectStart: " + url.host() + "/.+ DIRECT")
|
||||
.assertLogMatch("secureConnectStart")
|
||||
.assertLogMatch(
|
||||
"connectFailed: null javax\\.net\\.ssl\\.SSLProtocolException: Handshake message sequence violation, 1")
|
||||
"connectFailed: null javax\\.net\\.ssl\\.SSLProtocolException: (?:Unexpected handshake message: client_hello|Handshake message sequence violation, 1)")
|
||||
.assertLogMatch(
|
||||
"callFailed: javax.net.ssl.SSLProtocolException: Handshake message sequence violation, 1")
|
||||
"callFailed: javax\\.net\\.ssl\\.SSLProtocolException: (?:Unexpected handshake message: client_hello|Handshake message sequence violation, 1)")
|
||||
.assertNoMoreLogs();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user