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
merged 1 commit into from Dec 30, 2020

Conversation

rossabaker
Copy link
Member

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

java.lang.NullPointerException: Missing SslContextFactory
	at java.util.Objects.requireNonNull(Objects.java:228)
	at org.eclipse.jetty.io.ssl.SslClientConnectionFactory.<init>(SslClientConnectionFactory.java:54)
	at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1208)
	at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1214)
	at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:149)
	at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:155)
	at org.eclipse.jetty.client.HttpDestination.<init>(HttpDestination.java:95)
	at org.eclipse.jetty.client.PoolingHttpDestination.<init>(PoolingHttpDestination.java:25)
	at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.<init>(HttpDestinationOverHTTP.java:32)
	at org.eclipse.jetty.client.http.HttpClientTransportOverHTTP.newHttpDestination(HttpClientTransportOverHTTP.java:54)
	at org.eclipse.jetty.client.HttpClient.lambda$resolveDestination$0(HttpClient.java:575)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.eclipse.jetty.client.HttpClient.resolveDestination(HttpClient.java:573)
	at org.eclipse.jetty.client.HttpClient.resolveDestination(HttpClient.java:551)
	at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:599)
	at org.eclipse.jetty.client.HttpRequest.sendAsync(HttpRequest.java:778)
	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:765)
	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
…t-ssl

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

Successfully merging this pull request may close these issues.

None yet

2 participants