use of io.servicetalk.transport.api.HostAndPort in project servicetalk by apple.
the class TcpFastOpenTest method newClient.
private static BlockingHttpClient newClient(final ServerContext serverContext, final Collection<HttpProtocol> protocols, final boolean secure, @SuppressWarnings("rawtypes") final Map<SocketOption, Object> clientOptions) {
SingleAddressHttpClientBuilder<HostAndPort, InetSocketAddress> builder = HttpClients.forSingleAddress(serverHostAndPort(serverContext)).protocols(toConfigs(protocols));
if (secure) {
builder.sslConfig(new ClientSslConfigBuilder(DefaultTestCerts::loadServerCAPem).sniHostname(serverPemHostname()).build());
}
for (@SuppressWarnings("rawtypes") Entry<SocketOption, Object> entry : clientOptions.entrySet()) {
@SuppressWarnings("unchecked") SocketOption<Object> option = entry.getKey();
builder.socketOption(option, entry.getValue());
}
return builder.buildBlocking();
}
Aggregations