diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java index 4f3a11bd2b9..a9f7e965404 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java @@ -39,10 +39,10 @@ public interface HttpClientProvider Log.getLogger(HttpClientProvider.class).ignore(ignore); } - return new HttpClientProvider(){}.newHttpClient(); + return HttpClientProvider.newDefaultHttpClient(); } - default HttpClient newHttpClient() + private static HttpClient newDefaultHttpClient() { HttpClient client = new HttpClient(new SslContextFactory()); QueuedThreadPool threadPool = new QueuedThreadPool(); @@ -50,4 +50,9 @@ public interface HttpClientProvider client.setExecutor(threadPool); return client; } + + default HttpClient newHttpClient() + { + return newDefaultHttpClient(); + } }