Re: SSL connection

2013-11-28 Thread Oleg Kalnichevski
On Wed, 2013-11-27 at 19:24 +0100, Joan Balagueró wrote: Hello, I have an application (servlet running on tomcat) that must send a https request to a server that requires client authentication. Tomcat has correctly installed the truststore and keystore. But I understand that

Re: SSL connection

2013-11-28 Thread Grigoriy A. Polyakov
public GPSSL() { String URLs = https://myserver.doamin.kz;; URL url = new URL(URLs); con = (HttpsURLConnection) url.openConnection(); con.setSSLSocketFactory(getFactory(new File(key/keys.p12), 1234)); Authenticator.setDefault(new MyAuthenticator());

RE: SSL connection

2013-11-28 Thread Joan Balagueró
Hello Oleg, Thanks. I've been seeing some HttpClient samples. Some of them set the trustStore/keyStore directly to the SSLSocketFactory. And others create an SSLContext with them and then set this SSLContext to the SSLSocketFactory. Any advantage from one respect to the other? Furthermore,

Re: SSL connection

2013-11-28 Thread Oleg Kalnichevski
On Thu, 2013-11-28 at 20:11 +0100, Joan Balagueró wrote: Hello Oleg, Thanks. I've been seeing some HttpClient samples. Some of them set the trustStore/keyStore directly to the SSLSocketFactory. SSLSocketFactory constructors internally create an SSLContext instance and initialize it with the

Re: SSL connection

2013-11-28 Thread Oleg Kalnichevski
On Thu, 2013-11-28 at 22:12 +0100, Oleg Kalnichevski wrote: On Thu, 2013-11-28 at 20:11 +0100, Joan Balagueró wrote: .. Furthermore, when using SSLContext we need to create an instance using the secure socket protocol. Is there any way to accept all secure protocols? I am not sure what