Showing posts with label SSL. Show all posts
Showing posts with label SSL. Show all posts

Friday, April 12, 2013

Wednesday, March 28, 2012

Client authentication with SSL certificates in Tomcat

Place something like this in server.xml file:

      <Connector port="8443" 

           protocol="HTTP/1.1" 
           SSLEnabled="true"
           maxThreads="150" 

           scheme="https" 
           secure="true"
           sslProtocol="TLS"
           keystorePass="pass"
           keystoreFile="/data/abcd/someserver/server1.jks"
           truststoreFile="/data/abcd/eshop/AbcdRootCa.jks"
           truststorePass="pass"
           keyAlias="www.google.com"
           clientAuth="want"
           SSLVerifyClient="optional"
           SSLCACertificateFile="/data/abcd/someserver/AbcdRootCA.pem"
       />


Attention: clientAuth parameter, in Tomcat 6.0 can get value "want", so it accepts connections with and wothout certificates. The application could decide what to do with the two types of clients internally. Take attention Tomcat 6.0 COULD NOT understand option clientAuth="optional". I suppose it was valid sometime, but now it is not.

Monday, December 19, 2011

Connecting to HTTPS site with specific certificate in PHP

Here is an example how you could connect to a server, which requires that you identify yourself with a certificate.
Your certificate and the server certificate are signed by an authority whose certificate is in ca.ctr.