emqx / esockd

Erlang general non-blocking TCP/SSL socket server

Home Page:https://www.emqx.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't get peercert subject name in ppv2

HJianBo opened this issue · comments

The https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt has not supported the cert Subject Name, but we supported it with Common Name 😢

subject(nossl) -> undefined;
subject(undefined) -> undefined;
subject(Cert) when is_binary(Cert) ->
esockd_ssl:peer_cert_subject(Cert);
subject(PP2Info) when is_list(PP2Info) ->
%%Notice: DN is not available in ppv2 additional info
proplists:get_value(pp2_ssl_cn, PP2Info).

This issue was found while investigating emqx/emqx#9147