I want to force ssl client verification for on of my virtual hosts. But get "No required SSL certificate was sent" error, trying to GET something from it.

Here are my test configs:

# defaults                                                                                                                                                                    
ssl_certificate /etc/certs/server.cer;                                                                                                                                 
ssl_certificate_key /etc/certs/privkey-server.pem;                                                                                                                     
ssl_client_certificate /etc/certs/allcas.pem;                                                                                                                                 

server {                                                                                                                                                                      
    listen 1443 ssl;                                                                                                                                                          
    server_name server1.example.com;                                                                                                                                          
    root /tmp/root/server1;                                                                                                                                                   

    ssl_verify_client off;                                                                                                                                                    
}                                                                                                                                                                             

server {                                                                                                                                                                      
    listen 1443 ssl;                                                                                                                                                          
    server_name server2.example.com;                                                                                                                                          
    root /tmp/root/server2;                                                                                                                                                   

    ssl_verify_client on;                                                                                                                                                     
} 

First server replies with 200 http code, but second returns "400 Bad Request, No required SSL certificate was sent, nginx/1.0.4".

Probably, it is implossible to use ssl_verify_client on the same IP? Should I bind these servers to different IPs, will it solve my problem?

link|improve this question

50% accept rate
feedback

1 Answer

Have you loaded the client certificate (in PKCS12 format) signed by the CA "/etc/certs/allcas.pem" in your browser ? In Firefox, you can check your client certificats by going into Preferences -> Advanced -> Encryption -> View Certificates -> Your certificates.

The value of the parameter "ssl_verify_client" if "off" by default. You can also use the value "optional" if the SSL client certificate is not mandatory.

link|improve this answer
I'm used curl --cert ... with same results. – Alexander Artemenko Nov 2 '11 at 12:55
Is there anything interesting in the error log of nginx ? (probably /var/log/nginx/error.log) – user1025596 Nov 2 '11 at 13:48
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.