Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 22 for addTrustedCertificate (0.14 sec)

  1. 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,
            )
        }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 4.4K bytes
    - Viewed (0)
  2. 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)
  3. okhttp/src/jvmTest/kotlin/okhttp3/KotlinDeprecationErrorTest.kt

        val heldCertificate: HeldCertificate = HeldCertificate.Builder().build()
        builder = builder.heldCertificate(heldCertificate, heldCertificate.certificate())
        builder = builder.addTrustedCertificate(heldCertificate.certificate())
      }
    
      @Test @Disabled
      fun heldCertificate() {
        val heldCertificate: HeldCertificate = HeldCertificate.Builder().build()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  4. regression-test/src/androidTest/java/okhttp/regression/LetsEncryptTest.java

          Certificate isgCertificate = cf.generateCertificate(new ByteArrayInputStream(isgCert.getBytes("UTF-8")));
    
          HandshakeCertificates certificates = new HandshakeCertificates.Builder()
                  .addTrustedCertificate((X509Certificate) isgCertificate)
                  // Uncomment to allow connection to any site generally, but will cause
                  // noticeable memory pressure in Android apps.
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Nov 17 07:40:31 UTC 2020
    - 6.1K bytes
    - Viewed (0)
  5. 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
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat May 10 11:15:14 UTC 2025
    - 8.4K 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-testing-support/src/main/kotlin/okhttp3/testing/PlatformRule.kt

                .rsa2048()
                .build()
            return@lazy HandshakeCertificates
              .Builder()
              .heldCertificate(heldCertificate)
              .addTrustedCertificate(heldCertificate.certificate)
              .build()
          }
    
          init {
            val platformSystemProperty = getPlatformSystemProperty()
    
            if (platformSystemProperty == JDK9_PROPERTY) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 15.4K bytes
    - Viewed (1)
Back to top