Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for addTrustedCertificate (0.14 sec)

  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(
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 24.3K bytes
    - Viewed (1)
  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();
    ```
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 07 19:32:33 UTC 2025
    - 9.1K bytes
    - Viewed (0)
  3. 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(),
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 3.7K bytes
    - Viewed (0)
  4. mockwebserver/src/test/java/mockwebserver3/MockResponseSniTest.kt

            .addSubjectAlternativeName("url-host.com")
            .build()
        val handshakeCertificates =
          HandshakeCertificates
            .Builder()
            .heldCertificate(heldCertificate)
            .addTrustedCertificate(heldCertificate.certificate)
            .build()
        server.useHttps(handshakeCertificates.sslSocketFactory())
    
        val dns =
          Dns {
            Dns.SYSTEM.lookup(server.hostName)
          }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 6.3K bytes
    - Viewed (0)
  5. 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() {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 8K bytes
    - Viewed (0)
  6. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

            .signedBy(serverCa)
            .addSubjectAlternativeName(server.hostName)
            .build()
        val serverHandshakeCertificates =
          HandshakeCertificates
            .Builder()
            .addTrustedCertificate(clientCa.certificate)
            .heldCertificate(serverCertificate)
            .build()
        server.useHttps(serverHandshakeCertificates.sslSocketFactory(), false)
        server.enqueue(MockResponse().setBody("abc"))
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 03 13:16:34 UTC 2025
    - 22.3K bytes
    - Viewed (0)
  7. 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
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/ConnectionCoalescingTest.kt

        dns["nonsan.com"] = serverIps
        dns["www.wildcard.com"] = serverIps
        dns["differentdns.com"] = listOf()
        val handshakeCertificates =
          HandshakeCertificates
            .Builder()
            .addTrustedCertificate(rootCa.certificate)
            .build()
        client =
          clientTestRule
            .newClientBuilder()
            .fastFallback(false) // Avoid data races.
            .dns(dns)
            .sslSocketFactory(
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jun 19 11:44:16 UTC 2025
    - 19.1K bytes
    - Viewed (0)
  9. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

            .signedBy(serverCa)
            .addSubjectAlternativeName(server.hostName)
            .build()
        val serverHandshakeCertificates =
          HandshakeCertificates
            .Builder()
            .addTrustedCertificate(clientCa.certificate)
            .heldCertificate(serverCertificate)
            .build()
        server.useHttps(serverHandshakeCertificates.sslSocketFactory())
        server.enqueue(
          MockResponse
            .Builder()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sun Aug 03 22:38:00 UTC 2025
    - 28K bytes
    - Viewed (0)
  10. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

        val heldCertificate = HeldCertificate.Builder().build()
        builder = builder.heldCertificate(heldCertificate, heldCertificate.certificate)
        builder = builder.addTrustedCertificate(heldCertificate.certificate)
        builder = builder.addPlatformTrustedCertificates()
        val handshakeCertificates: HandshakeCertificates = builder.build()
      }
    
      @Test
      fun heldCertificate() {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 46.5K bytes
    - Viewed (0)
Back to top