cnn007 commented on issue #348:
URL: https://github.com/apache/apisix-docker/issues/348#issuecomment-1237778172

   > It looks like you didn't bring SNI when you visited, java may need to set 
an option to enable
   参考资料:
   https://github.com/dromara/hutool/issues/1573  
   两种解决方法
   方式1.升级jdk,
   方式2.使用
    <dependency>
               <groupId>org.apache.httpcomponents</groupId>
               <artifactId>httpclient</artifactId>
               <version>4.5.13</version>
           </dependency>
   
   `
   // test ok
       private static void testPost() throws Exception {
           Map<String, Object> body = new HashMap<>();
           body.put("param1", "xxx");
           body.put("param2", "xxx");
           String url = "https://xxx:4443/index.html";;
   
           // httpclient
           HttpPost httppost = new HttpPost(url);
   //        httppost.addHeader("Content-type", "application/json");
           StringEntity entity = new StringEntity(JSON.toJSONString(body));
           httppost.setEntity(entity);
           HttpClient httpclient = HttpClients.createDefault();
           HttpResponse resp = httpclient.execute(httppost);
           HttpEntity he = resp.getEntity();
           String respContent = EntityUtils.toString(he, "UTF-8");
           System.out.println(respContent);
       }
   `


-- 
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]

Reply via email to