Hello!
I have an annoying problem that maybe someone has already addressed.
I have a solution that connects to an HTTPS page (you download the
certificate in case of lack or variation), provides the certificate password
and then sends data.
Until recently I used this code that worked perfectly:
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);
The certificate is downloaded to the client; if I go to login page with a
OpenConnection, does not give errors. The certificate is NOT self-signed,
and I do not use proxy.
But now the manufacturer's protocol
(org.apache.commons.httpclient.protocol.Protocol with JDK 1.6.0_18 and
HTTPclient 3.1 or higher) which contained AuthSSLProtocolSocketFactory is
deprecated and no longer able to supply, resulting in the protection error
403, the launch of getPage.
I have to use the WebClient to simulate clicks of buttons and links.
What can I do?
--
View this message in context:
http://old.nabble.com/SSL-Connection-with-webclient.getpage-from-Java-client-error-403-tp33119210p33119210.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]