|
@@ -172,7 +172,7 @@ set_field(Name, Val, Channel) ->
|
|
|
%%--------------------------------------------------------------------
|
|
%%--------------------------------------------------------------------
|
|
|
|
|
|
|
|
-spec(init(emqx_types:conninfo(), proplists:proplist()) -> channel()).
|
|
-spec(init(emqx_types:conninfo(), proplists:proplist()) -> channel()).
|
|
|
-init(ConnInfo = #{peername := {PeerHost, PeerPort}}, Options) ->
|
|
|
|
|
|
|
+init(ConnInfo = #{peername := {PeerHost, _Port}}, Options) ->
|
|
|
Zone = proplists:get_value(zone, Options),
|
|
Zone = proplists:get_value(zone, Options),
|
|
|
Peercert = maps:get(peercert, ConnInfo, undefined),
|
|
Peercert = maps:get(peercert, ConnInfo, undefined),
|
|
|
Username = case peer_cert_as_username(Options) of
|
|
Username = case peer_cert_as_username(Options) of
|
|
@@ -184,7 +184,6 @@ init(ConnInfo = #{peername := {PeerHost, PeerPort}}, Options) ->
|
|
|
MountPoint = emqx_zone:get_env(Zone, mountpoint),
|
|
MountPoint = emqx_zone:get_env(Zone, mountpoint),
|
|
|
ClientInfo = #{zone => Zone,
|
|
ClientInfo = #{zone => Zone,
|
|
|
peerhost => PeerHost,
|
|
peerhost => PeerHost,
|
|
|
- peerport => PeerPort,
|
|
|
|
|
peercert => Peercert,
|
|
peercert => Peercert,
|
|
|
client_id => undefined,
|
|
client_id => undefined,
|
|
|
username => Username,
|
|
username => Username,
|