Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for addPlatformTrustedCertificates (0.16 sec)

  1. okhttp/src/test/java/okhttp3/InsecureForHostTest.kt

        server.useHttps(serverCertificates.sslSocketFactory())
        server.enqueue(MockResponse())
    
        val clientCertificates =
          HandshakeCertificates.Builder()
            .addPlatformTrustedCertificates()
            .addInsecureHost(server.hostName)
            .build()
    
        val client =
          clientTestRule.newClientBuilder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/DevServer.kt

              .setResponseCode(HTTP_MOVED_TEMP)
              .setHeader("Location", "https://www.google.com/robots.txt"),
          )
        }
    
      val clientCertificates =
        HandshakeCertificates.Builder()
          .addPlatformTrustedCertificates()
          .addInsecureHost(server.hostName)
          .build()
    
      val client =
        OkHttpClient.Builder()
          .sslSocketFactory(clientCertificates.sslSocketFactory(), clientCertificates.trustManager)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  3. okhttp-tls/api/okhttp-tls.api

    }
    
    public final class okhttp3/tls/HandshakeCertificates$Builder {
    	public fun <init> ()V
    	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;
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Feb 26 19:17:33 UTC 2022
    - 3.7K bytes
    - Viewed (0)
  4. okhttp-tls/README.md

    This is the behavior you'll get with your OkHttpClient if you don't specifically configure
    `HandshakeCertificates`. Or you can do it explicitly with `addPlatformTrustedCertificates()`:
    
    ```java
    HandshakeCertificates clientCertificates = new HandshakeCertificates.Builder()
        .addPlatformTrustedCertificates()
        .build();
    OkHttpClient client = new OkHttpClient.Builder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Dec 17 15:34:10 UTC 2023
    - 9.1K bytes
    - Viewed (0)
  5. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

        assumeNetwork()
    
        val request = Request.Builder().url("https://api.twitter.com/robots.txt").build()
    
        val clientCertificates =
          HandshakeCertificates.Builder()
            .addPlatformTrustedCertificates()
            .apply {
              if (Build.VERSION.SDK_INT >= 24) {
                addInsecureHost(server.hostName)
              }
            }
            .build()
    
        client =
          client.newBuilder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 27K bytes
    - Viewed (0)
  6. android-test/src/androidTest/java/okhttp/android/test/letsencrypt/LetsEncryptClientTest.kt

            """.trimIndent().decodeCertificatePem()
    
          val handshakeCertificates =
            HandshakeCertificates.Builder()
              // TODO reenable in official answers
    //      .addPlatformTrustedCertificates()
              .addTrustedCertificate(cert)
              .build()
    
          clientBuilder
            .sslSocketFactory(
              handshakeCertificates.sslSocketFactory(),
              handshakeCertificates.trustManager,
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  7. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

        val heldCertificate =
          HeldCertificate.Builder()
            .addSubjectAlternativeName("localhost")
            .build()
        return@lazy HandshakeCertificates.Builder()
          .addPlatformTrustedCertificates()
          .heldCertificate(heldCertificate)
          .addTrustedCertificate(heldCertificate.certificate)
          .build()
      }
    
      @Before
      fun init() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/kt/CustomTrust.kt

            .addTrustedCertificate(entrustRootCertificateAuthority)
            .addTrustedCertificate(comodoRsaCertificationAuthority)
            // Uncomment if standard certificates are also required.
            // .addPlatformTrustedCertificates()
            .build()
        client =
          OkHttpClient.Builder()
            .sslSocketFactory(certificates.sslSocketFactory(), certificates.trustManager)
            .build()
      }
    
      fun run() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  9. okhttp-tls/src/test/java/okhttp3/tls/HandshakeCertificatesTest.kt

          .isEqualTo(listOf(certificate.certificate, intermediate.certificate))
      }
    
      @Test fun platformTrustedCertificates() {
        val handshakeCertificates =
          HandshakeCertificates.Builder()
            .addPlatformTrustedCertificates()
            .build()
        val acceptedIssuers = handshakeCertificates.trustManager.acceptedIssuers
        val names =
          acceptedIssuers
            .map { it.subjectDN.name }
            .toSet()
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 11 22:09:35 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  10. okhttp-tls/src/main/kotlin/okhttp3/tls/HandshakeCertificates.kt

         * certificates. Applications that connect to a known set of servers may be able to mitigate
         * this problem with [certificate pinning][CertificatePinner].
         */
        fun addPlatformTrustedCertificates() =
          apply {
            val platformTrustManager = Platform.get().platformTrustManager()
            Collections.addAll(trustedCertificates, *platformTrustManager.acceptedIssuers)
          }
    
        /**
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 8.5K bytes
    - Viewed (0)
Back to top