Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 42 for useHttps (0.06 sec)

  1. 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()
    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. 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(),
        )
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Jan 14 10:20:09 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  3. 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"),
          )
        }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  4. 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(
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  5. 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(),
        )
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 23.8K bytes
    - Viewed (0)
  6. 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(),
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 131.7K bytes
    - Viewed (0)
  7. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockWebServer.kt

        replaceWith = ReplaceWith(expression = "protocols"),
        level = DeprecationLevel.ERROR,
      )
      fun protocols(): List<Protocol> = delegate.protocols
    
      fun useHttps(
        sslSocketFactory: SSLSocketFactory,
        tunnelProxy: Boolean,
      ) {
        delegate.useHttps(sslSocketFactory)
      }
    
      fun noClientAuth() {
        delegate.noClientAuth()
      }
    
      fun requestClientAuth() {
        delegate.requestClientAuth()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 23 14:31:42 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/HttpsServer.java

        HandshakeCertificates serverCertificates = new HandshakeCertificates.Builder()
            .heldCertificate(localhostCertificate)
            .build();
        MockWebServer server = new MockWebServer();
        server.useHttps(serverCertificates.sslSocketFactory(), false);
        server.enqueue(new MockResponse());
    
        HandshakeCertificates clientCertificates = new HandshakeCertificates.Builder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 02 14:04:37 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  9. 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()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Jan 14 10:20:09 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  10. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt

        mockWebServer.bodyLimit = 0L
        mockWebServer.protocolNegotiationEnabled = false
        mockWebServer.protocols = listOf()
        val protocols: List<Protocol> = mockWebServer.protocols
        mockWebServer.useHttps(SSLSocketFactory.getDefault() as SSLSocketFactory, false)
        mockWebServer.noClientAuth()
        mockWebServer.requestClientAuth()
        mockWebServer.requireClientAuth()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.3K bytes
    - Viewed (0)
Back to top