Пример #1
0
 @Test
 public void tlsBuilder_defaultCiphers() throws Exception {
   ConnectionSpec tlsSpec =
       new ConnectionSpec.Builder(true)
           .tlsVersions(TlsVersion.TLS_1_2)
           .supportsTlsExtensions(true)
           .build();
   assertNull(tlsSpec.cipherSuites());
   assertEquals(Arrays.asList(TlsVersion.TLS_1_2), tlsSpec.tlsVersions());
   assertTrue(tlsSpec.supportsTlsExtensions());
 }
Пример #2
0
 @Test
 public void tlsBuilder_explicitCiphers() throws Exception {
   ConnectionSpec tlsSpec =
       new ConnectionSpec.Builder(true)
           .cipherSuites(CipherSuite.TLS_RSA_WITH_RC4_128_MD5)
           .tlsVersions(TlsVersion.TLS_1_2)
           .supportsTlsExtensions(true)
           .build();
   assertEquals(Arrays.asList(CipherSuite.TLS_RSA_WITH_RC4_128_MD5), tlsSpec.cipherSuites());
   assertEquals(Arrays.asList(TlsVersion.TLS_1_2), tlsSpec.tlsVersions());
   assertTrue(tlsSpec.supportsTlsExtensions());
 }