Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an SslContextFactory to jetty-client #4110

merged 1 commit into from Dec 30, 2020


Copy link

Without this, https requests fail out of the box. That's a hostile default.

java.lang.NullPointerException: Missing SslContextFactory
	at java.util.Objects.requireNonNull(
	at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(
	at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(
	at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(
	at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(
	at org.eclipse.jetty.client.HttpDestination.<init>(
	at org.eclipse.jetty.client.PoolingHttpDestination.<init>(
	at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.<init>(
	at org.eclipse.jetty.client.http.HttpClientTransportOverHTTP.newHttpDestination(
	at org.eclipse.jetty.client.HttpClient.lambda$resolveDestination$0(
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(
	at org.eclipse.jetty.client.HttpClient.resolveDestination(
	at org.eclipse.jetty.client.HttpClient.resolveDestination(
	at org.eclipse.jetty.client.HttpClient.send(
	at org.eclipse.jetty.client.HttpRequest.sendAsync(
	at org.eclipse.jetty.client.HttpRequest.send(
	at org.http4s.client.jetty.JettyClient$.$anonfun$allocate$8(JettyClient.scala:44)

This client doesn't follow the builder pattern of the other backends. If it did, it should take an SslContextFactory parameter.

The workaround until this is released is to pass a fully configured client. See the defaultHttpClient function for how.

@rossabaker rossabaker added the enhancement Feature requests and improvements label Dec 30, 2020
@rossabaker rossabaker changed the base branch from main to series/0.21 December 30, 2020 21:08
@rossabaker rossabaker merged commit c9a039b into series/0.21 Dec 30, 2020
@rossabaker rossabaker deleted the jetty-client-default-ssl branch January 6, 2021 06:19
armanbilge pushed a commit to http4s/http4s-jetty-client that referenced this pull request May 20, 2022

Provide an SslContextFactory to jetty-client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
enhancement Feature requests and improvements
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants