fix(exproto): filter out ssl options if it disabled

This commit is contained in:
JianBo He 2022-03-09 14:27:03 +08:00
parent e72e49b291
commit f90b27c291
1 changed files with 8 additions and 4 deletions

View File

@ -127,10 +127,14 @@ start_grpc_server(GwName, Options = #{bind := ListenOn}) ->
services => #{ services => #{
'emqx.exproto.v1.ConnectionAdapter' => emqx_exproto_gsvr} 'emqx.exproto.v1.ConnectionAdapter' => emqx_exproto_gsvr}
}, },
SvrOptions = case maps:to_list(maps:get(ssl, Options, #{})) of SvrOptions = case emqx_map_lib:deep_get([ssl, enable], Options, false) of
[] -> []; false -> [];
SslOpts -> true ->
[{ssl_options, SslOpts}] [{ssl_options,
maps:to_list(
maps:without([enable], maps:get(ssl, Options, #{}))
)
}]
end, end,
case grpc:start_server(GwName, ListenOn, Services, SvrOptions) of case grpc:start_server(GwName, ListenOn, Services, SvrOptions) of
{ok, _SvrPid} -> {ok, _SvrPid} ->