Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 49 for Localhost (0.28 sec)

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

      private fun enableTls() {
        // Generate a self-signed cert for the server to serve and the client to trust.
        // can't use TlsUtil.localhost with a non OpenJSSE trust manager
        val heldCertificate =
          HeldCertificate.Builder()
            .commonName("localhost")
            .addSubjectAlternativeName("localhost")
            .build()
        val handshakeCertificates =
          HandshakeCertificates.Builder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  2. mockwebserver/src/test/java/mockwebserver3/MockResponseSniTest.kt

    import okhttp3.OkHttpClientTestRule
    import okhttp3.Request
    import okhttp3.testing.PlatformRule
    import okhttp3.tls.HandshakeCertificates
    import okhttp3.tls.HeldCertificate
    import okhttp3.tls.internal.TlsUtil.localhost
    import org.junit.jupiter.api.BeforeEach
    import org.junit.jupiter.api.Test
    import org.junit.jupiter.api.extension.RegisterExtension
    
    class MockResponseSniTest {
      @RegisterExtension
    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)
  3. okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt

      fun takeFrame(): InFrame = inFrames.take()
    
      fun play() {
        check(serverSocket == null)
        serverSocket = ServerSocket()
        serverSocket!!.reuseAddress = false
        serverSocket!!.bind(InetSocketAddress("localhost", 0), 1)
        port = serverSocket!!.localPort
        executor.execute {
          try {
            readAndWriteFrames()
          } catch (e: IOException) {
            ******@****.***uietly()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/HttpsServer.java

     */
    public class HttpsServer {
      public void run() throws Exception {
        HeldCertificate localhostCertificate = new HeldCertificate.Builder()
            .addSubjectAlternativeName("localhost")
            .build();
    
        HandshakeCertificates serverCertificates = new HandshakeCertificates.Builder()
            .heldCertificate(localhostCertificate)
            .build();
        MockWebServer server = new MockWebServer();
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 02 14:04:37 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  5. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainSocketFactory.java

        } catch (IOException e) {
          result.close();
          throw e;
        }
        return result;
      }
    
      @Override public Socket createSocket(
          String host, int port, InetAddress localHost, int localPort) throws IOException {
        return createSocket(host, port);
      }
    
      @Override public Socket createSocket(InetAddress host, int port) throws IOException {
        Socket result = createSocket();
    
        try {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 03 21:33:52 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  6. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

      @Test fun `choice IP address`() {
        val bytes = "8704c0a80201".decodeHex()
        val localhost = InetAddress.getByName("192.168.2.1").address.toByteString()
        assertThat(CertificateAdapters.generalName.fromDer(bytes))
          .isEqualTo(generalNameIpAddress to localhost)
        assertThat(CertificateAdapters.generalName.toDer(generalNameIpAddress to localhost))
          .isEqualTo(bytes)
      }
    
      @Test fun `choice dns`() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/HttpUrlJvmTest.kt

        assertThat("https://栃木.jp".toHttpUrl().topPrivateDomain()).isNull()
        assertThat("https://xn--4pvxs.jp".toHttpUrl().topPrivateDomain()).isNull()
        assertThat("https://localhost".toHttpUrl().topPrivateDomain()).isNull()
        assertThat("https://127.0.0.1".toHttpUrl().topPrivateDomain()).isNull()
    
        // https://github.com/square/okhttp/issues/6109
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  8. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

            .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)
  9. okhttp/src/test/java/okhttp3/RequestTest.kt

      fun uninitializedURI() {
        val request = Request.Builder().url("http://localhost/api").build()
        assertThat(request.url.toUri()).isEqualTo(URI("http://localhost/api"))
        assertThat(request.url).isEqualTo("http://localhost/api".toHttpUrl())
      }
    
      @Test
      fun newBuilderUrlResetsUrl() {
        val requestWithoutCache = Request.Builder().url("http://localhost/api").build()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 16.4K bytes
    - Viewed (0)
  10. okhttp-testing-support/src/main/kotlin/okhttp3/TestValueFactory.kt

    import okhttp3.internal.connection.RoutePlanner
    import okhttp3.internal.http.RealInterceptorChain
    import okhttp3.internal.http.RecordingProxySelector
    import okhttp3.tls.HandshakeCertificates
    import okhttp3.tls.internal.TlsUtil.localhost
    
    /**
     * OkHttp is usually tested with functional tests: these use public APIs to confirm behavior against
     * MockWebServer. In cases where logic is particularly tricky, we use unit tests. This class makes
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 7.7K bytes
    - Viewed (0)
Back to top