当我想在 https 网站上使用 HtmlUnit(2.10 版)时遇到问题。
我已经初始化了一个 WebClient 对象并指定了一些参数。
webClient.setSSLClientCertificate(URL,PASSWORD,"pkcs12");
webClient.setUseInsecureSSL(true);
setUseInsecureSSL 方法抛出 IllegalArgumentException 并带有以下消息:“Socket factory may not be null”
堆栈跟踪
org.apache.http.conn.scheme.Scheme.(Scheme.java:94) com.gargoylesoftware.htmlunit.HttpWebConnection.createHttpClient(HttpWebConnection.java:535) com.gargoylesoftware.htmlunit.HttpWebConnection.getHttpClient(HttpWebConnection.java:500 ) com.gargoylesoftware.htmlunit.HttpWebConnection.setUseInsecureSSL(HttpWebConnection.java:711) com.gargoylesoftware.htmlunit.WebClient.setUseInsecureSSL(WebClient.java:1096) mon.package.HtmlUnitAbstract.setSSLClientCertificate(HtmlUnitAbstract.java:66)
有人已经出现过这种错误吗?谢谢你的帮助。