Error : java.security.cert.CertificateException: Illegal given domain name: abc_xyz.stg.myweb.com

后端 未结 3 1920
温柔的废话
温柔的废话 2020-12-21 03:38

Hi team i found below exception when calling an api

https://abc_xyz.stg.myweb.com/api/AuthorizedUser?username=admin&password=admin

ja

3条回答
  •  春和景丽
    2020-12-21 04:20

    In case someone see this issue again and don't want to change jdk version, it is possible to disable the SSL Host name verification (and it is not the good solution but sometimes it is not possible to avoid this..) :

        HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
            public boolean verify(String hostname, SSLSession session) {
                return true;
            }
        });
    

提交回复
热议问题