hostname|HttpClient 访问Https报错hostname in certificate didn't match:
【hostname|HttpClient 访问Https报错hostname in certificate didn't match:】错误:
javax.net.ssl.SSLException:hostname in certificate didn't match:<**.**.****.com> != <*.****.com>
解决办法:
SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext,SSLConnectionSocktFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
推荐阅读
- certificate|解决windows7下 pycharm启动出现Server's certificate is not trusted提示框的问题
- Linux|Linux-hostname查看及修改
- Thinking|functional programming - define