<div dir="auto"><div dir="auto">If your application is using fastcgi or proxy configuration in nginx, you need to have nginx put the information from the certificate into a FastCGI parameter or an http header that your application can read.<div dir="auto"><br></div><div dir="auto">Use something like `fastcgi_param DN $ssl_client_s_dn;` for FastCGI or `proxy_set_header X-ClientCert-DN $ssl_client_s_dn;` for proxy.</div><div dir="auto"><br></div><div dir="auto">This is a good resource I have used in the past for configuring client certificates: <a href="http://blog.nategood.com/client-side-certificate-authentication-in-ngi" target="_blank" rel="noreferrer">http://blog.nategood.com/client-side-certificate-authentication-in-ngi</a></div><div dir="auto"><br></div><div dir="auto">Alternatively, you can pass the entire certificate to your application and let the application parse it all over again to extract what it wants with something like this: `proxy_set_header X-SSL-CERT $ssl_client_escaped_cert`. See here for more about that: <a href="https://serverfault.com/a/629017/105107" target="_blank" rel="noreferrer">https://serverfault.com/a/629017/105107</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 2, 2019, 12:24 AM vz19 <<a href="mailto:nginx-forum@forum.nginx.org" target="_blank" rel="noreferrer">nginx-forum@forum.nginx.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
My application uses NGINX as its web server and I am adding support for<br>
client certificate authentication. I have a requirement where after NGINX<br>
validates the client certificate and provides access to my application, I<br>
need to obtain the Subject field of the client certificate to parse certain<br>
certificate details from my application. Is there a way to obtain this<br>
information from the application level or does this information reside only<br>
on the NGINX layer? I tried using APIs like ngx_ssl_get_subject_dn from my<br>
application but that didn't work. Please provide some inputs or point me in<br>
the right direction if I'm missing something.<br>
<br>
Thanks<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,285079,285079#msg-285079" rel="noreferrer noreferrer noreferrer" target="_blank">https://forum.nginx.org/read.php?2,285079,285079#msg-285079</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" rel="noreferrer noreferrer" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer noreferrer noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div></div>