Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 22 for addTrustedCertificate (0.17 seconds)

  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 Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 24.4K 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 Apr 03 11:42:14 GMT 2026
    - Last Modified: Sun Mar 15 09:01:42 GMT 2026
    - 9.1K bytes
    - Click Count (0)
  3. samples/guide/src/main/java/okhttp3/recipes/CustomTrust.java

        HandshakeCertificates certificates = new HandshakeCertificates.Builder()
            .addTrustedCertificate(letsEncryptCertificateAuthority)
            .addTrustedCertificate(entrustRootCertificateAuthority)
            .addTrustedCertificate(comodoRsaCertificationAuthority)
            // Uncomment if standard certificates are also required.
            //.addPlatformTrustedCertificates()
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 9.3K bytes
    - Click Count (0)
  4. 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 Apr 03 11:42:14 GMT 2026
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 8.8K bytes
    - Click Count (0)
  5. 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 Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Feb 03 08:16:15 GMT 2026
    - 7.5K bytes
    - Click Count (0)
  6. 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)
          }
    
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Wed Jun 18 12:28:21 GMT 2025
    - 6.3K bytes
    - Click Count (0)
  7. samples/guide/src/main/java/okhttp3/recipes/HttpsServer.java

        server.useHttps(serverCertificates.sslSocketFactory(), false);
        server.enqueue(new MockResponse());
    
        HandshakeCertificates clientCertificates = new HandshakeCertificates.Builder()
            .addTrustedCertificate(localhostCertificate.certificate())
            .build();
        OkHttpClient client = new OkHttpClient.Builder()
            .sslSocketFactory(clientCertificates.sslSocketFactory(), clientCertificates.trustManager())
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Mon Jan 02 14:04:37 GMT 2023
    - 2.1K bytes
    - Click Count (0)
  8. android-test/src/androidDeviceTest/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 Apr 03 11:42:14 GMT 2026
    - Last Modified: Mon Jan 26 07:38:51 GMT 2026
    - 4.4K bytes
    - Click Count (0)
  9. 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 Apr 03 11:42:14 GMT 2026
    - Last Modified: Wed Jun 18 12:28:21 GMT 2025
    - 3.7K bytes
    - Click Count (0)
  10. okhttp-tls/api/okhttp-tls.api

    	public final fun addInsecureHost (Ljava/lang/String;)Lokhttp3/tls/HandshakeCertificates$Builder;
    	public final fun addPlatformTrustedCertificates ()Lokhttp3/tls/HandshakeCertificates$Builder;
    	public final fun addTrustedCertificate (Ljava/security/cert/X509Certificate;)Lokhttp3/tls/HandshakeCertificates$Builder;
    	public final fun build ()Lokhttp3/tls/HandshakeCertificates;
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Sat Feb 26 19:17:33 GMT 2022
    - 3.7K bytes
    - Click Count (0)
Back to Top