I have OpenSSL server and client.
Server allows connections only with one certificate by function SSL_CTX_load_verify_locations(ctx, cert, NULL)
, but it is not enough. I want to enable connections for all clients with certificate with was signed by organizational CA.
What should I use?
I have read about set path to folder with "good" client certificates, but it's actually not what I want and it's not working for me too.
Any ideas?
On the server, you need to call
SSL_CTX_set_client_CA_list
to have the server send the CA list (and trigger the client). In your case, the list is one CA - the organization's CA or a subordinate CA within the organization.You can find the OpenSSL man page at
SSL_CTX_set_client_CA_list(3)
. Its also discussed on theSSL_CTX_load_verify_locations(3)
man page.Here's how to find an example of using it (OpenSSL is famous for self documenting code):
Here's how OpenSSL uses it
apps/s_server.c
:You can find the man pages for
SSL_load_client_CA_file(3)
.Related, on the OpenSSL mailing list: Does
STACK_OF(X509_NAME)
need to be free'd when usingSSL_load_client_CA_file?
Assuming your organization PKI looks something like so:
You probably want to send the
Client Authentication
subordinate CA. That limits damage in case something happens in one of the other CA arcs.The problem case is that of Diginotar, where the Root CA becomes compromised. In that case, you need to burn the entire PKI to the ground and start over.
The subordinate CAs will have
basicConstraint=critical, CA=true
. But they will not be self signed. Rather, they will be signed or certified by theOrganizational Root CA
.