Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for certificatePinner (0.23 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()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 14.2K bytes
    - Viewed (1)
  2. 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
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 23.8K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Address.kt

      )
      fun hostnameVerifier(): HostnameVerifier? = hostnameVerifier
    
      @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 &&
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  4. 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()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/ConnectionCoalescingTest.kt

      /** Can still coalesce when pinning is used if pins match.  */
      @Test
      fun coalescesWhenCertificatePinsMatch() {
        val pinner =
          CertificatePinner.Builder()
            .add("san.com", pin(certificate.certificate))
            .build()
        client = client.newBuilder().certificatePinner(pinner).build()
        server.enqueue(MockResponse())
        server.enqueue(MockResponse())
        assert200Http2Response(execute(url), server.hostName)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 18.7K 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()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/kt/CertificatePinning.kt

     * limitations under the License.
     */
    package okhttp3.recipes.kt
    
    import java.io.IOException
    import okhttp3.CertificatePinner
    import okhttp3.OkHttpClient
    import okhttp3.Request
    
    class CertificatePinning {
      private val client =
        OkHttpClient.Builder()
          .certificatePinner(
            CertificatePinner.Builder()
              .add("publicobject.com", "sha256/Vjs8r4z+80wjNcr1YKepWQboSIRi63WsWXhIMN+eWys=")
              .build(),
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  8. docs/features/https.md

              for (certificate in response.handshake!!.peerCertificates) {
                println(CertificatePinner.pin(certificate))
              }
            }
          }
        ```
    === ":material-language-java: Java"
        ```java
          private final OkHttpClient client = new OkHttpClient.Builder()
              .certificatePinner(
                  new CertificatePinner.Builder()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Dec 24 00:16:30 GMT 2022
    - 10.5K bytes
    - Viewed (0)
  9. 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
          }
    
        /**
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 04:21:33 GMT 2024
    - 52K bytes
    - Viewed (0)
  10. 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. */
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 14:55:09 GMT 2024
    - 2.1K bytes
    - Viewed (0)
Back to top