fix(exproto): don't carry the ssl confs if ssl.enable is false
This commit is contained in:
parent
670749493b
commit
094c4ad262
|
@ -166,14 +166,16 @@ start_grpc_client_channel(GwName, Options = #{address := Address}) ->
|
||||||
}})
|
}})
|
||||||
|
|
||||||
end,
|
end,
|
||||||
case maps:to_list(maps:get(ssl, Options, #{})) of
|
case emqx_map_lib:deep_get([ssl, enable], Options, false) of
|
||||||
[] ->
|
false ->
|
||||||
SvrAddr = compose_http_uri(http, Host, Port),
|
SvrAddr = compose_http_uri(http, Host, Port),
|
||||||
grpc_client_sup:create_channel_pool(GwName, SvrAddr, #{});
|
grpc_client_sup:create_channel_pool(GwName, SvrAddr, #{});
|
||||||
SslOpts ->
|
true ->
|
||||||
|
SslOpts = maps:to_list(maps:get(ssl, Options, #{})),
|
||||||
ClientOpts = #{gun_opts =>
|
ClientOpts = #{gun_opts =>
|
||||||
#{transport => ssl,
|
#{transport => ssl,
|
||||||
transport_opts => SslOpts}},
|
transport_opts => SslOpts}},
|
||||||
|
|
||||||
SvrAddr = compose_http_uri(https, Host, Port),
|
SvrAddr = compose_http_uri(https, Host, Port),
|
||||||
grpc_client_sup:create_channel_pool(GwName, SvrAddr, ClientOpts)
|
grpc_client_sup:create_channel_pool(GwName, SvrAddr, ClientOpts)
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue