Cheat Sheet - Http Client SSL TLS Configuration for Java, Kotlin and Scala with example http requests
The examples below use the base ssl configuration found here: SSLConfig of the library: Ayza
Java
| import org.gradle.api.DefaultTask | |
| import org.gradle.api.Project | |
| import org.gradle.api.artifacts.Configuration | |
| import org.gradle.api.artifacts.ConfigurationContainer | |
| import org.gradle.api.artifacts.Dependency | |
| import org.gradle.api.artifacts.ExternalModuleDependency | |
| import org.gradle.api.artifacts.ProjectDependency | |
| import org.gradle.api.artifacts.dsl.DependencyHandler | |
| import org.gradle.api.artifacts.result.ResolvedArtifactResult | |
| import org.gradle.api.artifacts.result.UnresolvedArtifactResult |
| // implementation("org.zeroturnaround:zt-exec:1.12") LIBRARY USAGED | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.runtime.collectAsState | |
| import kotlin.coroutines.resume | |
| import kotlinx.coroutines.channels.awaitClose | |
| import kotlinx.coroutines.flow.Flow | |
| import kotlinx.coroutines.flow.callbackFlow | |
| import kotlinx.coroutines.flow.collect | |
| import kotlinx.coroutines.flow.flow |
| /* | |
| * MIT License | |
| * | |
| * Copyright (c) 2021 Brice Dutheil <brice.dutheil@gmail.com> | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import java.io.IOException; | |
| import java.net.http.HttpClient; | |
| import java.net.http.HttpRequest; | |
| import java.net.http.HttpResponse; | |
| import java.net.http.HttpResponse.BodyHandler; | |
| import java.time.Duration; | |
| import java.util.concurrent.CompletableFuture; |
| /* | |
| * Copyright 2020 The Netty Project | |
| * | |
| * The Netty Project licenses this file to you under the Apache License, | |
| * version 2.0 (the "License"); you may not use this file except in compliance | |
| * with the License. You may obtain a copy of the License at: | |
| * | |
| * https://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| @file:Suppress("ObsoleteKotlinJsPackages") | |
| package baaahs.util | |
| import kotlin.browser.window | |
| object ConsoleFormatters { | |
| fun install() { | |
| window.asDynamic().devtoolsFormatters = arrayOf( | |
| map, set, list |
| // Using a hypothetical channel API, I assume I have channel `in` with a 4096-wide buffer, | |
| // and a channel `out` writing to Kafka. | |
| // lookupNodeInRedis and processOnServer have semaphores of, say, 16 and 8, to *globally* limit | |
| // concurrent use of those resources. | |
| var processingQueue = new BufferedChannel(50); // this buffer bounds the number of processing threads | |
| // Consume and process input | |
| Thread.startVirtualThread(() -> { |
| com/sun/jdi/connect/spi/Connection | |
| com/sun/jndi/dns/BaseNameClassPairEnumeration | |
| com/sun/jndi/dns/DnsClient | |
| com/sun/jndi/dns/DnsContext | |
| com/sun/jndi/dns/Resolver | |
| com/sun/jndi/ldap/AbstractLdapNamingEnumeration | |
| com/sun/jndi/ldap/LdapCtx | |
| com/sun/jndi/ldap/LdapReferralContext | |
| com/sun/jndi/ldap/LdapSchemaCtx | |
| com/sun/jndi/ldap/ext/StartTlsResponseImpl |