Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 13 for addTrustedCertificate (0.09 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. okhttp/src/jvmTest/kotlin/okhttp3/internal/tls/CertificatePinnerChainValidationTest.kt

            .add(server.hostName, pin(goodIntermediateCa.certificate))
            .build()
        val handshakeCertificates =
          HandshakeCertificates
            .Builder()
            .addTrustedCertificate(rootCa.certificate)
            .addTrustedCertificate(compromisedRootCa.certificate)
            .build()
        val client =
          clientTestRule
            .newClientBuilder()
            .sslSocketFactory(
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Fri Jun 20 11:46:46 GMT 2025
    - 24.3K bytes
    - Click Count (2)
  2. okhttp-tls/README.md

    to trust. In this simplified example we trust the server's self-signed certificate:
    
    ```java
    HandshakeCertificates clientCertificates = new HandshakeCertificates.Builder()
        .addTrustedCertificate(localhostCertificate.certificate())
        .build();
    OkHttpClient client = new OkHttpClient.Builder()
        .sslSocketFactory(clientCertificates.sslSocketFactory(), clientCertificates.trustManager())
        .build();
    ```
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Thu Oct 30 21:39:59 GMT 2025
    - 9.1K bytes
    - Click Count (0)
  3. samples/guide/src/main/java/okhttp3/recipes/kt/CustomTrust.kt

        val certificates =
          HandshakeCertificates
            .Builder()
            .addTrustedCertificate(letsEncryptCertificateAuthority)
            .addTrustedCertificate(entrustRootCertificateAuthority)
            .addTrustedCertificate(comodoRsaCertificationAuthority)
            // Uncomment if standard certificates are also required.
            // .addPlatformTrustedCertificates()
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 8.8K bytes
    - Click Count (0)
  4. okhttp-tls/src/test/java/okhttp3/tls/HandshakeCertificatesTest.kt

            .build()
        val server =
          HandshakeCertificates
            .Builder()
            .addTrustedCertificate(clientRoot.certificate)
            .heldCertificate(serverCertificate, serverIntermediate.certificate)
            .build()
        val client =
          HandshakeCertificates
            .Builder()
            .addTrustedCertificate(serverRoot.certificate)
            .heldCertificate(clientCertificate, clientIntermediate.certificate)
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 7.2K bytes
    - Click Count (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/OpenJSSETest.kt

            .addSubjectAlternativeName("localhost")
            .build()
        val handshakeCertificates =
          HandshakeCertificates
            .Builder()
            .heldCertificate(heldCertificate)
            .addTrustedCertificate(heldCertificate.certificate)
            .build()
    
        client =
          client
            .newBuilder()
            .sslSocketFactory(
              handshakeCertificates.sslSocketFactory(),
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Jun 18 12:28:21 GMT 2025
    - 3.7K bytes
    - Click Count (0)
  6. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/TlsUtil.kt

            .addSubjectAlternativeName("localhost.localdomain")
            .build()
        return@lazy HandshakeCertificates
          .Builder()
          .heldCertificate(heldCertificate)
          .addTrustedCertificate(heldCertificate.certificate)
          .build()
      }
    
      /** Returns an SSL client for this host's localhost address. */
      @JvmStatic
      fun localhost(): HandshakeCertificates = localhost
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 4.3K bytes
    - Click Count (1)
  7. android-test/src/androidTest/java/okhttp/android/test/letsencrypt/LetsEncryptClientTest.kt

          val handshakeCertificates =
            HandshakeCertificates
              .Builder()
              // TODO reenable in official answers
    //      .addPlatformTrustedCertificates()
              .addTrustedCertificate(cert)
              .build()
    
          clientBuilder
            .sslSocketFactory(
              handshakeCertificates.sslSocketFactory(),
              handshakeCertificates.trustManager,
            )
        }
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 4.4K bytes
    - Click Count (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/SocketChannelTest.kt

              .commonName(hostname)
              .addSubjectAlternativeName(hostname)
              .build()
          HandshakeCertificates
            .Builder()
            .heldCertificate(heldCertificate)
            .addTrustedCertificate(heldCertificate.certificate)
            .build()
        }
      private var acceptedHostName: String? = null
    
      @StartStop
      private val server = MockWebServer()
    
      @BeforeEach
      fun setUp() {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Nov 01 12:18:11 GMT 2025
    - 7.9K bytes
    - Click Count (0)
  9. okhttp-tls/src/main/kotlin/okhttp3/tls/HandshakeCertificates.kt

        }
    
        /**
         * Add a trusted root certificate to use when authenticating a peer. Peers must provide
         * a chain of certificates whose root is one of these.
         */
        fun addTrustedCertificate(certificate: X509Certificate) =
          apply {
            this.trustedCertificates += certificate
          }
    
        /**
         * Add all of the host platform's trusted root certificates. This set varies by platform
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat May 10 11:15:14 GMT 2025
    - 8.4K bytes
    - Click Count (0)
  10. okhttp/src/jvmTest/kotlin/okhttp3/internal/tls/ClientAuthTest.kt

      private fun buildClient(
        heldCertificate: HeldCertificate?,
        vararg intermediates: X509Certificate,
      ): OkHttpClient {
        val builder =
          HandshakeCertificates
            .Builder()
            .addTrustedCertificate(serverRootCa.certificate)
        if (heldCertificate != null) {
          builder.heldCertificate(heldCertificate, *intermediates)
        }
        val handshakeCertificates = builder.build()
        return clientTestRule
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 04 19:13:52 GMT 2025
    - 13K bytes
    - Click Count (0)
Back to Top