java访问https,获取页面或者数据时,需要证书和账号密码的验证。 一 获取CRT证书 获取网站的证书,拿到证书后可能是crt格式,可以使用下面的命令转为p12格式 openssl pkcs12 -export -in Mycert.crt -inkey Mykey.key -out Mycert.p12 -name "Mycert" Mycert.crt是证书,Mykey.key是生成证书同时生成的key,最终转出Mycert.p12 二 访问https,不需要账号密码 比如访问如下地址 https://hf.anjuke.com/esf-ajax/community/pc/autocomplete?city_id=33&kw=%E9%9D%92%E9%98%B3%E6%96%B0%E6%9D%91&type=3 public static void GetSSLJson4() throws Exception { final String certFile = "C:/Users/682556/wux-presto.seagate.com.p12";//证书 final...