dsmiley commented on code in PR #2689:
URL: https://github.com/apache/solr/pull/2689#discussion_r1742191640


##########
solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java:
##########
@@ -347,22 +348,27 @@ PublicKey fetchPublicKeyFromRemote(String nodename) {
     HttpEntity entity = null;
     try {
       String uri = url + PublicKeyHandler.PATH + "?wt=json&omitHeader=true";
+      ModifiableSolrParams solrParams = new ModifiableSolrParams();
+      solrParams.add("wt", "json");
+      solrParams.add("omitHeader", "true");
+
+      GenericSolrRequest request =
+          new GenericSolrRequest(SolrRequest.METHOD.GET, 
PublicKeyHandler.PATH, solrParams);
+
       log.debug("Fetching fresh public key from: {}", uri);
-      HttpResponse rsp =
-          cores
-              .getUpdateShardHandler()
-              .getDefaultHttpClient()
-              .execute(new HttpGet(uri), 
HttpClientUtil.createNewHttpClientRequestContext());
-      entity = rsp.getEntity();
-      byte[] bytes = EntityUtils.toByteArray(entity);
-      Map<?, ?> m = (Map<?, ?>) Utils.fromJSON(bytes);
-      String key = (String) m.get("key");
-      if (key == null) {
-        log.error("No key available from {}{}", url, PublicKeyHandler.PATH);
-        return null;
-      } else {
-        log.info("New key obtained from node={}, key={}", nodename, key);
+
+      String key;
+      try (Http2SolrClient solrClient = new 
Http2SolrClient.Builder(url).build()) {

Review Comment:
   I deprecated setBasePath but should have better clarified that there is no 
substitute yet and thus for code inside Solr (what we're talking about here) 
definitely should continue to use it. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to