来自Java客户端的webclient.getpage的SSL连接错误403

来自Java客户端的webclient.getpage的SSL连接错误403,java,tomcat,https,httpclient,ssl-certificate,Java,Tomcat,Https,Httpclient,Ssl Certificate,我有一个恼人的问题,也许有人已经解决了 我有一个连接到HTTPS页面的解决方案(如果缺少或有变化,您可以下载证书),提供证书密码,然后发送数据 直到最近,我才使用了这段代码,它工作得非常好 Protocol authhttps = new Protocol("https", new org.apache.commons.httpclient.contrib.ssl.AuthSSLProtocolSocketFactory(keyStoreKeys, qCertPassword, null, qC

我有一个恼人的问题,也许有人已经解决了

我有一个连接到HTTPS页面的解决方案(如果缺少或有变化,您可以下载证书),提供证书密码,然后发送数据

直到最近,我才使用了这段代码,它工作得非常好

Protocol authhttps = new Protocol("https", new org.apache.commons.httpclient.contrib.ssl.AuthSSLProtocolSocketFactory(keyStoreKeys, qCertPassword, null, qCertPassword), 443); 
Protocol.registerProtocol("https", authhttps);

WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3);

DefaultCredentialsProvider userCredentials = (DefaultCredentialsProvider) webClient.getCredentialsProvider();
userCredentials.addCredentials(qUsername, qPassword, host, 443, realm);
webClient.setCredentialsProvider(userCredentials);

HtmlPage page = webClient.getPage(SiteHttpsUrl);
将证书下载到客户端;如果我使用OpenConnection进入登录页面,则不会给出错误。证书不是自签名的,我不使用代理

但是现在,制造商的协议(
org.apache.commons.httpclient.protocol.protocol
JDK 1.6.0_18
httpclient 3.1
或更高版本)中包含
AuthSSLProtocolSocketFactory
已被弃用,不再能够提供,导致保护错误403,启动
getPage

我必须使用
WebClient
来模拟按钮和链接的点击

我能做什么