#Is there a way to get the peer certificate from a glisten ssl connection?
1 messages · Page 1 of 1 (latest)
i don't think so... if that's just this https://www.erlang.org/doc/apps/ssl/ssl.html#peercert/1 then shouldn't be too hard to add support
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
thanks! I'll try the external, but it'd be useful to have in glisten. :)
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.
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.
I guess I could give it a verify_fun that does nothing...
That kinda seems to be the way to do it.
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