We are wanting to use two way certificate authentication using open ssl.
When we open s_server as follows, the client is able to connect to my server:
openssl s_server -accept 12345 -cert our-cert.pem
(our-cert.pem is our certificate.)
This works fine. However, my requirements are:
I have tried this:
openssl s_server -accept 12345 -cert our-cert.pem -CApath /etc/ssl/certs/
This allows the client to connect. But my questions are:
The s_server command implements a generic SSL/TLS server which listens for connections on a given port using SSL/TLS.
DESCRIPTION. The s_client command implements a generic SSL/TLS client which connects to a remote host using SSL/TLS. It is a very useful diagnostic tool for SSL servers.
For the server, you need to add the "-Verify " option to force the client to provide a certificate. The depth is the maximum length of the client certificate chain.
That should take care of question #1.
For #2, I'm not sure there is a way to restrict by Common Name using these OpenSSL commands.
You can see the OpenSSL documentation for the server/client commands here:
s_server
s_client
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With