C0urante commented on code in PR #13415:
URL: https://github.com/apache/kafka/pull/13415#discussion_r1142078897


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/RestClient.java:
##########
@@ -97,7 +98,11 @@ public <T> HttpResponse<T> httpRequest(String url, String 
method, HttpHeaders he
     public <T> HttpResponse<T> httpRequest(String url, String method, 
HttpHeaders headers, Object requestBodyData,
                                                   TypeReference<T> 
responseFormat,
                                                   SecretKey sessionKey, String 
requestSignatureAlgorithm) {
-        HttpClient client = httpClient();
+        // Only try to load SSL configs if we have to (see KAFKA-14816)
+        SslContextFactory sslContextFactory = url.startsWith("https://";)
+                ? SSLUtils.createClientSideSslContextFactory(config)
+                : null;
+        HttpClient client = httpClient(sslContextFactory);

Review Comment:
   We wanted to be conservative about unintended changes in behavior (😞), and 
weren't certain about the thread safety of the `HttpClient` class. Discussion 
thread 
[here](https://github.com/apache/kafka/pull/12828#discussion_r1020382238).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to