Skip to content

how to validate client certificate #11

Answered by surfskidude
badiku asked this question in Q&A
Discussion options

You must be logged in to vote

Are you using the Mako Server?
If so, there appears to be an undocumented feature for mako.conf. I have this in my mako.conf testup:

certfile="localhost.pem"
keyfile="localhost.key"
certstore="ca.pem"

The certstore attribute makes the code in mako.zip/.openports create a certificate store for the server listen object. When I run your code:

if request:clientcert() then
   local certT,trusted = request:certificate()
   print("You are", trusted and "" or "not", "trusted")
   print(ba.json.encode(certT))
end

I get

You are		trusted
{"san":["mycert"],"issuer":{"countryname":"US","commonname":"Real Time Logic Root CA","province":"California","locality":"Dana Point","organization":"Real Time L…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@badiku
Comment options

Comment options

You must be logged in to vote
1 reply
@badiku
Comment options

Answer selected by surfskidude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants