Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for firstOrNull (0.24 sec)

  1. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/Certificate.kt

    ) {
      val commonName: Any?
        get() {
          return tbsCertificate.subject
            .flatten()
            .firstOrNull { it.type == ObjectIdentifiers.COMMON_NAME }
            ?.value
        }
    
      val organizationalUnitName: Any?
        get() {
          return tbsCertificate.subject
            .flatten()
            .firstOrNull { it.type == ObjectIdentifiers.ORGANIZATIONAL_UNIT_NAME }
            ?.value
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/tls/BasicTrustRootIndex.kt

        val issuer = cert.issuerX500Principal
        val subjectCaCerts = subjectToCaCerts[issuer] ?: return null
    
        return subjectCaCerts.firstOrNull {
          try {
            cert.verify(it.publicKey)
            return@firstOrNull true
          } catch (_: Exception) {
            return@firstOrNull false
          }
        }
      }
    
      override fun equals(other: Any?): Boolean {
        return other === this ||
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Handshake.kt

      /** Returns the remote peer's principle, or null if that peer is anonymous. */
      @get:JvmName("peerPrincipal")
      val peerPrincipal: Principal?
        get() = (peerCertificates.firstOrNull() as? X509Certificate)?.subjectX500Principal
    
      @JvmName("-deprecated_peerPrincipal")
      @Deprecated(
        message = "moved to val",
        replaceWith = ReplaceWith(expression = "peerPrincipal"),
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/FastFallbackTest.kt

      @BeforeEach
      internal fun setUp() {
        val inetAddresses = InetAddress.getAllByName("localhost")
        localhostIpv4 = inetAddresses.firstOrNull { it is Inet4Address }
          ?: throw TestAbortedException()
        localhostIpv6 = inetAddresses.firstOrNull { it is Inet6Address }
          ?: throw TestAbortedException()
    
        serverIpv4 = MockWebServer()
        serverIpv4.start(localhostIpv4, 0) // Pick any available port.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/AsyncDns.kt

                },
              )
            }
    
            latch.await()
    
            // No mutations should be possible after this point
            if (allAddresses.isEmpty()) {
              val first = allExceptions.firstOrNull() ?: UnknownHostException("No results for $hostname")
    
              allExceptions.drop(1).forEach {
                first.addSuppressed(it)
              }
    
              throw first
            }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/JsseDebugLogging.kt

        return OkHttpDebugLogging.enable(
          "javax.net.ssl",
          object : Handler() {
            override fun publish(record: LogRecord) {
              val param = record.parameters?.firstOrNull() as? String
              debugHandler(JsseDebugMessage(record.message, param))
            }
    
            override fun flush() {
            }
    
            override fun close() {
            }
          },
        )
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/RecordedResponse.kt

          assertThat(messages).contains(failure!!.message)
        }
    
      fun assertFailureMatches(vararg patterns: String) =
        apply {
          val message = failure!!.message!!
          assertThat(
            patterns.firstOrNull { pattern ->
              message.matches(pattern.toRegex())
            },
          ).isNotNull()
        }
    
      fun assertSentRequestAtMillis(
        minimum: Long,
        maximum: Long,
      ) = apply {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  8. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/Adapters.kt

            val peekedHeader =
              reader.peekHeader()
                ?: throw ProtocolException("expected a value at $reader")
    
            val choice =
              choices.firstOrNull { it.matches(peekedHeader) }
                ?: throw ProtocolException(
                  "expected a matching choice but was $peekedHeader at $reader",
                )
    
            return choice to choice.fromDer(reader)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 15K bytes
    - Viewed (0)
  9. samples/tlssurvey/src/main/kotlin/okhttp3/survey/Iana.kt

      return SuiteId(id, matcher.groupValues[3])
    }
    
    class IanaSuites(
      val name: String,
      val suites: List<SuiteId>,
    ) {
      fun fromJavaName(javaName: String): SuiteId {
        return suites.firstOrNull {
          it.name == javaName || it.name == "TLS_${javaName.drop(4)}"
        } ?: throw IllegalArgumentException("No such suite: $javaName")
      }
    }
    
    suspend fun fetchIanaSuites(okHttpClient: OkHttpClient): IanaSuites {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 2K bytes
    - Viewed (0)
  10. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/RecordedRequest.kt

        replaceWith = ReplaceWith("body.readUtf8()"),
        level = DeprecationLevel.WARNING,
      )
      fun getUtf8Body(): String = body.readUtf8()
    
      fun getHeader(name: String): String? = headers.values(name).firstOrNull()
    
      override fun toString(): String = requestLine
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.1K bytes
    - Viewed (2)
Back to top