Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for useHttps (0.17 sec)

  1. okhttp/src/test/java/okhttp3/internal/tls/ClientAuthTest.kt

            .build()
      }
    
      @Test
      fun clientAuthForWants() {
        val client = buildClient(clientCert, clientIntermediateCa.certificate)
        val socketFactory = buildServerSslSocketFactory()
        server.useHttps(socketFactory)
        server.requestClientAuth()
        server.enqueue(
          MockResponse.Builder()
            .body("abc")
            .build(),
        )
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/InsecureForHostTest.kt

        platform.assumeNotBouncyCastle()
      }
    
      @Test fun `untrusted host in insecureHosts connects successfully`() {
        val serverCertificates = platform.localhostHandshakeCertificates()
        server.useHttps(serverCertificates.sslSocketFactory())
        server.enqueue(MockResponse())
    
        val clientCertificates =
          HandshakeCertificates.Builder()
            .addPlatformTrustedCertificates()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  3. mockwebserver/src/test/java/mockwebserver3/MockResponseSniTest.kt

      }
    
      @Test
      fun clientSendsServerNameAndServerReceivesIt() {
        // java.net.ConnectException: Connection refused
        platform.assumeNotConscrypt()
    
        val handshakeCertificates = localhost()
        server.useHttps(handshakeCertificates.sslSocketFactory())
    
        val dns =
          Dns {
            Dns.SYSTEM.lookup(server.hostName)
          }
    
        val client =
          clientTestRule.newClientBuilder()
            .sslSocketFactory(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.9K bytes
    - Viewed (1)
  4. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

            override fun createSocket(
              host: String,
              port: Int,
              localHost: InetAddress,
              localPort: Int,
            ): Socket? = null
          }
        if (useHttps) {
          server.useHttps(handshakeCertificates.sslSocketFactory())
          client =
            client.newBuilder()
              .sslSocketFactory(
                handshakeCertificates.sslSocketFactory(),
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/RouteFailureTest.kt

              handshakeCertificates.trustManager,
            )
            .hostnameVerifier(RecordingHostnameVerifier())
            .build()
        server1.useHttps(handshakeCertificates.sslSocketFactory())
        server2.useHttps(handshakeCertificates.sslSocketFactory())
      }
    
      private fun executeSynchronously(request: Request): RecordedResponse {
        val call = client.newCall(request)
        return try {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/kt/DevServer.kt

    import okhttp3.tls.HandshakeCertificates
    import okhttp3.tls.internal.TlsUtil
    
    class DevServer {
      val handshakeCertificates = TlsUtil.localhost()
    
      val server =
        MockWebServer().apply {
          useHttps(handshakeCertificates.sslSocketFactory(), false)
    
          enqueue(
            MockResponse()
              .setResponseCode(HTTP_MOVED_TEMP)
              .setHeader("Location", "https://www.google.com/robots.txt"),
          )
        }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/tls/CertificatePinnerChainValidationTest.kt

            .build()
        val serverHandshakeCertificates =
          HandshakeCertificates.Builder()
            .heldCertificate(certificate, intermediateCa.certificate)
            .build()
        server.useHttps(serverHandshakeCertificates.sslSocketFactory())
    
        // The request should complete successfully.
        server.enqueue(
          MockResponse.Builder()
            .body("abc")
            .build(),
        )
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 23.8K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/CallTest.kt

        noRecoverWhenRetryOnConnectionFailureIsFalse()
      }
    
      @Test
      fun tlsHandshakeFailure_noFallbackByDefault() {
        platform.assumeNotBouncyCastle()
    
        server.useHttps(handshakeCertificates.sslSocketFactory())
        server.enqueue(MockResponse(socketPolicy = FailHandshake))
        server.enqueue(MockResponse(body = "response that will never be received"))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  9. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

          OkHttpClient.Builder()
            .dns(AsyncDns.toDns(AndroidAsyncDns.IPv4, AndroidAsyncDns.IPv6))
            .sslSocketFactory(localhost.sslSocketFactory(), localhost.trustManager)
            .build()
    
        serverRule.server.useHttps(localhost.sslSocketFactory())
      }
    
      @Test
      @Ignore("java.net.UnknownHostException: No results for localhost, in CI.")
      fun testRequest() {
        serverRule.server.enqueue(MockResponse())
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  10. okhttp-logging-interceptor/src/test/java/okhttp3/logging/LoggingEventListenerTest.kt

          .assertLogMatch(Regex("""connectionReleased"""))
          .assertLogMatch(Regex("""callEnd"""))
          .assertNoMoreLogs()
      }
    
      @Test
      fun secureGet() {
        assumeNotWindows()
        server.useHttps(handshakeCertificates.sslSocketFactory())
        url = server.url("/")
        server.enqueue(MockResponse())
        val response = client.newCall(request().build()).execute()
        assertThat(response.body).isNotNull()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 10.2K bytes
    - Viewed (0)
Back to top