I am trying to run the following command:
[ root@localhost certs]
On the server, I have the following code:
certificateFile = /opt/openssl-1.0.0a/ssl/certwork/server.crt privatKeyFile = /opt/openssl-1.0.0a/ssl/certwork/server.key ctx = Ctx::client_server(certificateFile, privateKeyFile); ctx->context()->verify_mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT | SSL_VERIFY_CLIENT_ONCE; ctx->context()->client_CA = SSL_load_client_CA_file("/opt/openssl-1.0.0a/ssl/certwork_client/ca.crt");
context() calls methods in OpenSSLs ssl.h.
I created a CA server (certificate authority) and server certificates with the following commands:
cd /opt/openssl-1.0.0a/ssl mkdir certwork chmod 600 certwork cd certwork openssl genrsa -des3 -out ca.key 4096 openssl req -new -x509 -days 365 -key ca.key -out ca.crt openssl genrsa -des3 -out server.key 4096 openssl req -new -key server.key -out server.csr openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt
I created client CA and client certificates with the following commands:
cd /opt/openssl-1.0.0a/ssl mkdir certwork_client chmod 600 certwork_client cd certwork_client openssl genrsa -des3 -out ca.key 4096 openssl req -new -x509 -days 365 -key ca.key -out ca.crt openssl genrsa -des3 -out client.key 4096 openssl req -new -key client.key -out client.csr openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out client.crt
I can make server-side authentication work with certificates, but when I add client-side verification using certificates, I get the tlsv1 alert unknown ca:s3_pkt.c:1193:SSL alert number 48 error.
I configure the client to use the CA servers ( /opt/openssl-1.0.0a/ssl/certwork/ca.crt ), and I configure the server to use the CA CA file ( /opt/openssl-1.0.0a/ssl/certwork_client/ca.crt ).
What am I missing?
source share