security - Can a rails controller request mutual SSL authentication? -
force_ssl
can used on rails controller request ssl. there way controller request mutual authentication, , if yes, how can controller, request context, discover certificate presented client during ssl/tls handshake?
you can access client certificate using request.cgi
certificate = request.cgi.env_table['ssl_client_cert'].gsub(/(\n|-----(begin|end) certificate-----)/, '');
now can find user based on certificate.
see http://www.scatmania.org/projects/ssl-client-certificate-authentication-in-ruby-on-rails/ further information.
i not sure if works if using specific server(apache w. passenger e.g.).
edit:
http://www.modssl.org/docs/2.8/ssl_reference.html#toc24 might useful too.
Comments
Post a Comment