Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 32 for peerCertificates (0.15 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/CheckHandshake.java

            "sha256/afwiKY3RxoMmLkuRW1l7QsPZTJPwDS2pdDROQjXw8ig=");
    
        @Override public Response intercept(Chain chain) throws IOException {
          for (Certificate certificate : chain.connection().handshake().peerCertificates()) {
            String pin = CertificatePinner.pin(certificate);
            if (denylist.contains(pin)) {
              throw new IOException("Denylisted peer certificate: " + pin);
            }
          }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Apr 15 14:55:09 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/CustomTrust.kt

              }
              throw IOException("Unexpected code $response")
            }
            println(response.body.string())
    
            for (peerCertificate in response.handshake?.peerCertificates.orEmpty()) {
              println((peerCertificate as X509Certificate).subjectDN)
            }
          }
      }
    }
    
    fun main() {
      CustomTrust().run()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 8.8K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/RecordedResponse.kt

          assertThat(handshake.tlsVersion).isNotNull()
          assertThat(handshake.cipherSuite).isNotNull()
          assertThat(handshake.peerPrincipal).isNotNull()
          assertThat(handshake.peerCertificates.size).isEqualTo(1)
          assertThat(handshake.localPrincipal).isNull()
          assertThat(handshake.localCertificates.size).isEqualTo(0)
        }
    
      /**
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/CallKotlinTest.kt

        val response = client.newCall(request).execute()
    
        response.use {
          assertEquals(200, response.code)
          assertEquals(
            "CN=localhost",
            (response.handshake!!.peerCertificates.single() as X509Certificate).subjectDN.name,
          )
        }
      }
    
      private fun enableTls() {
        client =
          client
            .newBuilder()
            .sslSocketFactory(
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 8.4K bytes
    - Viewed (0)
  5. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/RealConnection.kt

      }
    
      private fun certificateSupportHost(
        url: HttpUrl,
        handshake: Handshake,
      ): Boolean {
        val peerCertificates = handshake.peerCertificates
    
        return peerCertificates.isNotEmpty() &&
          OkHostnameVerifier.verify(url.host, peerCertificates[0] as X509Certificate)
      }
    
      @Throws(SocketException::class)
      internal fun newCodec(
        client: OkHttpClient,
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 14.9K bytes
    - Viewed (0)
  6. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/tls/OkHostnameVerifier.kt

      override fun verify(
        host: String,
        session: SSLSession,
      ): Boolean =
        if (!host.isAscii()) {
          false
        } else {
          try {
            verify(host, session.peerCertificates[0] as X509Certificate)
          } catch (_: SSLException) {
            false
          }
        }
    
      fun verify(
        host: String,
        certificate: X509Certificate,
      ): Boolean =
        when {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 7.6K bytes
    - Viewed (0)
  7. okhttp-logging-interceptor/src/test/java/okhttp3/logging/LoggingEventListenerTest.kt

          .assertLogMatch(Regex("""secureConnectStart"""))
          .assertLogMatch(
            Regex(
              """secureConnectEnd: Handshake\{tlsVersion=TLS_1_[23] cipherSuite=TLS_.* peerCertificates=\[CN=localhost] localCertificates=\[]\}""",
            ),
          ).assertLogMatch(Regex("""connectEnd: h2"""))
          .assertLogMatch(
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  8. docs/changelogs/upgrading_to_okhttp_4.md

     * **Cookie**: domain, expiresAt, hostOnly, httpOnly, name, path, persistent, value
     * **Dispatcher**: executorService
     * **FormBody**: size
     * **Handshake**: cipherSuite, localCertificates, localPrincipal, peerCertificates, peerPrincipal,
       tlsVersion
     * **HandshakeCertificates**: keyManager, trustManager
     * **Headers**: size
     * **HeldCertificate**: certificate, keyPair
     * **HttpLoggingInterceptor**: level
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sun Feb 06 16:58:16 UTC 2022
    - 10.9K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/kt/CertificatePinning.kt

            .build()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          for (certificate in response.handshake!!.peerCertificates) {
            println(CertificatePinner.pin(certificate))
          }
        }
      }
    }
    
    fun main() {
      CertificatePinning().run()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/CertificatePinning.java

        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
          for (Certificate certificate : response.handshake().peerCertificates()) {
            System.out.println(CertificatePinner.pin(certificate));
          }
        }
      }
    
      public static void main(String... args) throws Exception {
        new CertificatePinning().run();
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sun Dec 08 21:30:01 UTC 2019
    - 1.7K bytes
    - Viewed (0)
Back to top