Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client certificate prompt not showing nginx

Tags:

nginx

ssl

I have got a ca certificate bundle trying to integrate client certificate authentication on nginx at the browser level i am not able to get a prompt asking for certificate to be sent for ssl authentication. I am not sure what's missed out here any help in this regard would be highly appreciated.

Below is the configuration of nginx

    #
    # HTTPS server configuration
    #

    server {
        listen          10.0.111.118:8443;
        ssl         on;
            server_name     reverseproxy.in;

        ### SSL cert files ###
            ssl_certificate      conf.d/MonetServer.cer;
            ssl_certificate_key  conf.d/MonetServer.key;
            ssl_client_certificate      conf.d/Bundle.crt;



        ssl_verify_client on;

        server_tokens off; 
        access_log      logs/ssl/esmarts-access.log;
        error_log       logs/ssl/esmarts-error.log;
        proxy_set_header  Host $host;
        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  X-Forwarded-Proto $scheme;
        proxy_set_header  X-Floof-SSL-Client-Serial $ssl_client_serial;
        proxy_set_header  X-Floof-SSL-Client-Verify $ssl_client_verify;






        ### We want full access to SSL via backend ###
            location / {
                proxy_pass  http://10.0.111.125:8080/esmart/index.html;

            ### force timeouts if one of backend is died ##
                proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

            ### Set headers ####
                    proxy_set_header        Accept-Encoding   "";
                proxy_set_header        Host            $host;
                proxy_set_header        X-Real-IP       $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-SSL-Client-S-DN   $ssl_client_cert;
            ### Most PHP, Python, Rails, Java App can use this header ###
            #proxy_set_header X-Forwarded-Proto https;##
            #This is better##
                proxy_set_header        X-Forwarded-Proto $scheme;
            add_header              Front-End-Https   on;


            ### By default we don't want to redirect it ####
                proxy_redirect     off;
          }

          location /esmart/VAADIN
           {

         proxy_pass  http://10.0.111.125:8080/esmart/VAADIN;

                    ### force timeouts if one of backend is died ##
                    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

                    ### Set headers ####
                    proxy_set_header        Accept-Encoding   "";
                    proxy_set_header        Host            $host;
                    proxy_set_header        X-Real-IP       $remote_addr;
                    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-SSL-Client-S-DN   $ssl_client_cert;
                    ### Most PHP, Python, Rails, Java App can use this header ###
                    #proxy_set_header X-Forwarded-Proto https;##
                    #This is better##
                    proxy_set_header        X-Forwarded-Proto $scheme;
                    add_header              Front-End-Https   on;


                    ### By default we don't want to redirect it ####
                    proxy_redirect     off;
           }

          location /esmart/jsp
           {

         proxy_pass  http://10.0.111.125:8080/esmart/jsp;

                    ### force timeouts if one of backend is died ##
                    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

                    ### Set headers ####
                    proxy_set_header        Accept-Encoding   "";
                    proxy_set_header        Host            $host;
                    proxy_set_header        X-Real-IP       $remote_addr;
                    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-SSL-Client-S-DN   $ssl_client_cert;


                    ### Most PHP, Python, Rails, Java App can use this header ###
                    #proxy_set_header X-Forwarded-Proto https;##
                    #This is better##
                    proxy_set_header        X-Forwarded-Proto $scheme;
                    add_header              Front-End-Https   on;


                    ### By default we don't want to redirect it ####
                    proxy_redirect     off;
           }


          location /esmart/APP
           {

         proxy_pass  http://10.0.111.125:8080/esmart/APP;

                    ### force timeouts if one of backend is died ##
                    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

                    ### Set headers ####
                    proxy_set_header        Accept-Encoding   "";
                    proxy_set_header        Host            $host;
                    proxy_set_header        X-Real-IP       $remote_addr;
                    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-SSL-Client-S-DN   $ssl_client_cert;

                    ### Most PHP, Python, Rails, Java App can use this header ###
                    #proxy_set_header X-Forwarded-Proto https;##
                    #This is better##
                    proxy_set_header        X-Forwarded-Proto $scheme;
                    add_header              Front-End-Https   on;


                    ### By default we don't want to redirect it ####
                    proxy_redirect     off;
           }





      }

I kept getting the error

400 Bad Request

No required SSL certificate was sent

Have already installed client certificate on my pc , Problem here is that i assume the browser is not requesting for the client certificate which is already installed on the client.

like image 313
zeemz Avatar asked Jul 28 '14 11:07

zeemz


1 Answers

Just posted an answer here: https://serverfault.com/a/764509/344286

Make sure you can authenticate using cURL to validate that your nginx is set up correctly. Once you've confirmed this, you can focus on generating a PKCS12 profile and installing that in the browser.

like image 80
user2325282 Avatar answered Sep 25 '22 06:09

user2325282