Rafa_F  
              
                  
                    April 13, 2016,  2:02am
                   
                  1 
               
             
            
              Hi, i was wanting to return a 403 when invalid client certificate
Nginx server block -
server {
   listen       443 ssl;
   server_name  server.com;
   ssl_certificate   /etc/nginx/server.crt;
   ssl_certificate_key  /etc/nginx/server.key;
   ssl_client_certificate  /etc/nginx/client_ca.crt;
   ssl_verify_client optional;
   ssl_verify_depth 2;
   if ($ssl_client_verify != SUCCESS ) {
   return 403;
   }
Posted at Nginx Forum:
  
  
    
  Hi, i was wanting to return a 403 when invalid client certificate submitted, however Nginx 1.9.6 returning 400 Bad Request, The SSL Certificate Error. Seems to return 403 fine when no certificate is submitted, but any clues on getting it to return a...
   
  
    
    
  
  
 
             
            
              
            
                
           
          
            
            
              … i also tried adding below, but still wouldn’t return a 403?
   error_page 400 =403 /;
Posted at Nginx Forum:
  
  
    
  Hi, i was wanting to return a 403 when invalid client certificate submitted, however Nginx 1.9.6 returning 400 Bad Request, The SSL Certificate Error. Seems to return 403 fine when no certificate is submitted, but any clues on getting it to return a...
   
  
    
    
  
  
 
             
            
              
            
                
           
          
            
            
              Does anyone know of any way to re-map a 400 response code?
Posted at Nginx Forum:
  
  
    
  Hi, i was wanting to return a 403 when invalid client certificate submitted, however Nginx 1.9.6 returning 400 Bad Request, The SSL Certificate Error. Seems to return 403 fine when no certificate is submitted, but any clues on getting it to return a...
   
  
    
    
  
  
 
             
            
              
            
                
           
          
            
            
              On 13 Apr 2016, at 03:01, Ramon_Ali [email protected] 
  server_name  server.com;
  }
 
http://nginx.org/en/docs/http/ngx_http_ssl_module.html#errors 
error_page  495  496  =403  /403.html;
–
             
            
              
            
                
           
          
            
            
              Ahh, as i wasn’t seeing the 495 and 496 codes in the logs, only 400 i
Thanks Igor.
2016/04/14 21:46:51 [info] 7#7: *1 client SSL certificate verify error:server.jetstar.com , request:server.com ”[email protected] ” “/C=AU/ST=NSW/O=NSI/OU=HQ/CN=Cert[email protected] ”;“FAILED”
Posted at Nginx Forum:
  
  
    
  Hi, i was wanting to return a 403 when invalid client certificate submitted, however Nginx 1.9.6 returning 400 Bad Request, The SSL Certificate Error. Seems to return 403 fine when no certificate is submitted, but any clues on getting it to return a...