Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for certificatePinner (0.15 sec)

  1. okhttp/src/main/kotlin/okhttp3/CertificatePinner.kt

     *
     * ```java
     * String hostname = "publicobject.com";
     * CertificatePinner certificatePinner = new CertificatePinner.Builder()
     *     .add(hostname, "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=")
     *     .build();
     * OkHttpClient client = OkHttpClient.Builder()
     *     .certificatePinner(certificatePinner)
     *     .build();
     *
     * Request request = new Request.Builder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 14.2K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/CertificatePinnerTest.kt

        certificatePinner.check("www.example.com", listOf(certA1.certificate))
      }
    
      @Test
      fun absentHostnameMatches() {
        val certificatePinner = CertificatePinner.Builder().build()
        certificatePinner.check("example.com", listOf(certA1.certificate))
      }
    
      @Test
      fun successfulCheckForWildcardHostname() {
        val certificatePinner =
          CertificatePinner.Builder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Address.kt

      @JvmName("-deprecated_certificatePinner")
      @Deprecated(
        message = "moved to val",
        replaceWith = ReplaceWith(expression = "certificatePinner"),
        level = DeprecationLevel.ERROR,
      )
      fun certificatePinner(): CertificatePinner? = certificatePinner
    
      override fun equals(other: Any?): Boolean {
        return other is Address &&
          url == other.url &&
          equalsNonHost(other)
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/tls/CertificatePinnerChainValidationTest.kt

    import javax.net.ssl.TrustManager
    import kotlin.test.assertFailsWith
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import mockwebserver3.SocketPolicy.DisconnectAtEnd
    import okhttp3.CertificatePinner
    import okhttp3.CertificatePinner.Companion.pin
    import okhttp3.OkHttpClientTestRule
    import okhttp3.RecordingHostnameVerifier
    import okhttp3.Request
    import okhttp3.internal.platform.Platform.Companion.get
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 23.8K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt

         * Pinning certificates avoids the need to trust certificate authorities.
         */
        fun certificatePinner(certificatePinner: CertificatePinner) =
          apply {
            if (certificatePinner != this.certificatePinner) {
              this.routeDatabase = null
            }
    
            this.certificatePinner = certificatePinner
          }
    
        /**
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Apr 06 04:21:33 UTC 2024
    - 52K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/CertificatePinnerKotlinTest.kt

      @Test
      fun successfulCheckSha1Pin() {
        val certificatePinner =
          CertificatePinner.Builder()
            .add("example.com", "sha1/" + certA1.certificate.sha1Hash().base64())
            .build()
    
        certificatePinner.check("example.com", listOf(certA1.certificate))
      }
    
      @Test fun successfulFindMatchingPins() {
        val certificatePinner =
          CertificatePinner.Builder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

            ) = TODO()
          }
      }
    
      @Test
      fun certificatePinner() {
        val heldCertificate: HeldCertificate = HeldCertificate.Builder().build()
        val certificate: X509Certificate = heldCertificate.certificate
        val certificatePinner: CertificatePinner = CertificatePinner.Builder().build()
        val certificates: List<Certificate> = listOf()
        certificatePinner.check("", listOf(certificate))
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 46.5K bytes
    - Viewed (0)
  8. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

      @Test
      fun testCertificatePinningSuccess() {
        enableTls()
    
        val certificatePinner =
          CertificatePinner.Builder()
            .add(
              server.hostName,
              CertificatePinner.pin(handshakeCertificates.trustManager.acceptedIssuers[0]),
            )
            .build()
        client = client.newBuilder().certificatePinner(certificatePinner).build()
    
        server.enqueue(MockResponse(body = "abc"))
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 27K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/CheckHandshake.java

     * limitations under the License.
     */
    package okhttp3.recipes;
    
    import java.io.IOException;
    import java.security.cert.Certificate;
    import java.util.Collections;
    import java.util.Set;
    import okhttp3.CertificatePinner;
    import okhttp3.Interceptor;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class CheckHandshake {
      /** Rejects otherwise-trusted certificates. */
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 14:55:09 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/connection/ConnectPlan.kt

              )
            }
          }
    
          val certificatePinner = address.certificatePinner!!
    
          val handshake =
            Handshake(
              unverifiedHandshake.tlsVersion,
              unverifiedHandshake.cipherSuite,
              unverifiedHandshake.localCertificates,
            ) {
              certificatePinner.certificateChainCleaner!!.clean(
                unverifiedHandshake.peerCertificates,
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Apr 20 17:03:43 UTC 2024
    - 18.6K bytes
    - Viewed (0)
Back to top