How to mimic browser X509 client certificate verification without access to HTTP layer

后端 未结 1 924
逝去的感伤
逝去的感伤 2021-01-23 10:51

I was reading this article on authentication via a X509 client certificate, but I won\'t be able to get the server to request a client certificate as I\'m running the applicatio

1条回答
  •  被撕碎了的回忆
    2021-01-23 11:09

    Your app stack isn't able to control SSL cause it's terminated on the web server. All the verification stuff is done by the web server and then only SSL_* headers go to the app server (look for Apache's SSLOptions for example). If you can't control web server you probably cant even turn on client certificate requirement. And i can't find any options to turn this requirement on via heroku: https://devcenter.heroku.com/articles/ssl#customdomain-ssl

    If you've got SSL_* headers somehow then, regardless of web-server-side verification, you can verify certificate (commonly in the SSL_CLIENT_CERT header) using openssl as an army knife. See this for example in ruby: OpenSSL verify certificate from own CA

    Also keep in mind that certificate verification is the process of checking certificate sign and other properties e.g. formal checking. To authenticate user you have to link that verified certificate to user by DN or E field, for example.

    0 讨论(0)
提交回复
热议问题