Merge pull request #9404 from JimMoen/fix-typo-50

fix(typo): typo in code
This commit is contained in:
Zaiming (Stone) Shi 2022-11-24 09:39:43 +01:00 committed by GitHub
commit b879c935eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -378,10 +378,14 @@ get_peer_info(Type, Listener, Req, Opts) ->
of of
#{src_address := SrcAddr, src_port := SrcPort, ssl := SSL} -> #{src_address := SrcAddr, src_port := SrcPort, ssl := SSL} ->
SourceName = {SrcAddr, SrcPort}, SourceName = {SrcAddr, SrcPort},
%% Notice: Only CN is available in Proxy Protocol V2 additional info %% Notice: CN is only available in Proxy Protocol V2 additional info.
%% `CN` is unsupported in Proxy Protocol V1
%% `pp2_ssl_cn` is required by config `peer_cert_as_username` or `peer_cert_as_clientid`.
%% It will be parsed by esockd.
%% See also `emqx_channel:set_peercert_infos/3` and `esockd_peercert:common_name/1`
SourceSSL = SourceSSL =
case maps:get(cn, SSL, undefined) of case maps:get(cn, SSL, undefined) of
undeined -> nossl; undefined -> undefined;
CN -> [{pp2_ssl_cn, CN}] CN -> [{pp2_ssl_cn, CN}]
end, end,
{SourceName, SourceSSL}; {SourceName, SourceSSL};