Implementing a java SSL and TLS server socket with client authentication
<p>I'm working on a project which consists on developping a TLS and SSL JAVA TCP/IP (Socket) server.</p>

<p>The Server must accept TLS and SSL TCP/IP Connections.</p>

<p>Actually i developed a multithreaded Server which can accept and respond to many clients in the same time but i still don't see a solution to make it work with TLS and SSL connections</p>

<p>I have read about the <code>SSLServerSocket</code> and <code>ServerSocketFactory</code> but I didn't get how can they help me with the certificate:</p>

<p>I didn't know how to give the socket The CA file path (the private certificate path)  (e.g: CAfile=D:\projects\mytools\eclipse\TunRootCA1.pem or rootcert.crt) like in Stunnel</p>

<p>let me describe the situation more precisely:
actually, the project i'm working on, consists on developing a server JAVA application which connects with POS devices working with TLS or SSL certificate.
The server has to accept the flow and make some fonctional controles (such as amounts,PAN, ...) then switch it to a third party server.
The server has to work with a one side certificate verification:
the clients use a certificate (.ca) downloaded from a national authority web site and the server uses a certificate signed from the same national authority agency
all parts of the server are ready except the TLS and SSL connection
thanks</p>

<p>I'd appreciate if anyone can describe me steps (with code samples) to implement a JAVA SSL and TLS server TCP/IP socket (with the above described behaviour)</p>

<p>Thanks a lot</p>