#Is there a way to get the peer certificate from a glisten ssl connection?

1 messages · Page 1 of 1 (latest)

frail lily
#

I didn't see any obvious way in the glisten docs.

worldly parrot
#

the Connection type isn't opaque at least, so you should be able to have that as an external and pass connection.socket to it and get that info... can add that to the library as well though, for a longer-term solution

frail lily
#

thanks! I'll try the external, but it'd be useful to have in glisten. :)

frail lily
#

So peercert/1 doesn't work, because the server doesn't request the client certificate. The server configuration needs {verify, verify_peer} which is verify_none by default.

worldly parrot
#

where are you seeing that default?

#

ah wrong section, i see

frail lily
#

nvm that doesn't solve my issue as that'll deny any bad/missing certificate requests... Damn I need to find a way to just get/check the client certificate.

frail lily
#

I guess I could give it a verify_fun that does nothing...

frail lily
worldly parrot
#

i'd probably like to provide some better public API for providing options, which could include "arbitrary" ones like this... i'm just not sure what the best approach is for that right now