在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java  網(wǎng)絡安全/ java通過引用OkHttp3訪問https報:handshake alert:

java通過引用OkHttp3訪問https報:handshake alert: unrecognized_name

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());
        }
    }
回答
編輯回答
只愛你

設置系統(tǒng)屬性:

System.setProperty ("jsse.enableSNIExtension", "false")

如果是tomcat,則catalina.sh增加:-Djsse.enableSNIExtension=false

2018年4月10日 10:44