2018-01-23 09:57:31.467 INFO [http-nio-9090-exec-1] com.qtay.gls.utils.OkHttpUtils - 出错原因:handshake alert: unrecognized_name
public void post(String url, RequestBody formBody) {
try {
Request request = new Request.Builder()
.url(url)
.post(formBody)
.build();
Response response = client.newCall(request).execute();
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
System.out.println(response.body());
System.out.println("4");
} catch (Exception ex) {
log.info("出错原因:" + ex.getMessage());
}
}
设置系统属性:
如果是tomcat,则catalina.sh增加:-Djsse.enableSNIExtension=false