Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for PeerCertificates (1.33 sec)

  1. okhttp/src/main/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,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  2. regression-test/src/androidTest/java/okhttp/regression/IssueReproductionTest.java

          assertTrue(response.code() == 200 || response.code() == 404);
          assertEquals(Protocol.HTTP_2, response.protocol());
    
          for (Certificate c: response.handshake().peerCertificates()) {
            X509Certificate x = (X509Certificate) c;
            System.out.println(x.getSubjectDN());
          }
        }
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jul 26 06:37:08 GMT 2021
    - 1.9K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Handshake.kt

      )
      fun cipherSuite(): CipherSuite = cipherSuite
    
      @JvmName("-deprecated_peerCertificates")
      @Deprecated(
        message = "moved to val",
        replaceWith = ReplaceWith(expression = "peerCertificates"),
        level = DeprecationLevel.ERROR,
      )
      fun peerCertificates(): List<Certificate> = peerCertificates
    
      /** Returns the remote peer's principle, or null if that peer is anonymous. */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/HandshakeTest.kt

            cipherSuite = CipherSuite.TLS_AES_128_GCM_SHA256,
            peerCertificates = listOf(serverCertificate.certificate, serverIntermediate.certificate),
            localCertificates = listOf(),
          )
    
        assertThat(handshake.tlsVersion).isEqualTo(TlsVersion.TLS_1_3)
        assertThat(handshake.cipherSuite).isEqualTo(CipherSuite.TLS_AES_128_GCM_SHA256)
        assertThat(handshake.peerCertificates).containsExactly(
          serverCertificate.certificate,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/CertificatePinner.kt

      fun check(
        hostname: String,
        peerCertificates: List<Certificate>,
      ) {
        return check(hostname) {
          (certificateChainCleaner?.clean(peerCertificates, hostname) ?: peerCertificates)
            .map { it as X509Certificate }
        }
      }
    
      internal fun check(
        hostname: String,
        cleanedPeerCertificatesFn: () -> List<X509Certificate>,
      ) {
        val pins = findMatchingPins(hostname)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 14.2K bytes
    - Viewed (1)
  6. okhttp/src/main/kotlin/okhttp3/internal/connection/ConnectPlan.kt

          if (!address.hostnameVerifier!!.verify(address.url.host, sslSocketSession)) {
            val peerCertificates = unverifiedHandshake.peerCertificates
            if (peerCertificates.isNotEmpty()) {
              val cert = peerCertificates[0] as X509Certificate
              throw SSLPeerUnverifiedException(
                """
                |Hostname ${address.url.host} not verified:
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  7. okhttp-tls/src/test/java/okhttp3/tls/HandshakeCertificatesTest.kt

          .isEqualTo(serverHandshake.peerCertificates)
        assertThat(listOf(serverCertificate.certificate, serverIntermediate.certificate))
          .isEqualTo(serverHandshake.localCertificates)
        val clientHandshake = clientHandshakeFuture.get()
        assertThat(listOf(serverCertificate.certificate, serverIntermediate.certificate))
          .isEqualTo(clientHandshake.peerCertificates)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 7.1K bytes
    - Viewed (0)
  8. 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();
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 08 21:30:01 GMT 2019
    - 1.7K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/DelegatingSSLSession.kt

      override fun getValueNames(): Array<String> {
        return delegate!!.valueNames
      }
    
      @Throws(SSLPeerUnverifiedException::class)
      override fun getPeerCertificates(): Array<Certificate>? {
        return delegate!!.peerCertificates
      }
    
      override fun getLocalCertificates(): Array<Certificate>? {
        return delegate!!.localCertificates
      }
    
      @Throws(SSLPeerUnverifiedException::class)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  10. 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()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
Back to top