fix(http): force enable ssl when https

This commit is contained in:
Zaiming (Stone) Shi 2023-12-13 09:36:28 +01:00
parent fa85c3061b
commit a6357d92f8
2 changed files with 5 additions and 2 deletions

View File

@ -205,7 +205,9 @@ on_start(
http -> http ->
{tcp, []}; {tcp, []};
https -> https ->
SSLOpts = emqx_tls_lib:to_client_opts(maps:get(ssl, Config)), SSLConf = maps:get(ssl, Config),
%% force enable ssl
SSLOpts = emqx_tls_lib:to_client_opts(SSLConf#{enable => true}),
{tls, SSLOpts} {tls, SSLOpts}
end, end,
NTransportOpts = emqx_utils:ipv6_probe(TransportOpts), NTransportOpts = emqx_utils:ipv6_probe(TransportOpts),

View File

@ -150,7 +150,8 @@ tr_handler_conf(#{logs := LogsConf, exporter := ExporterConf}) ->
ssl_opts(Endpoint, SSLOpts) -> ssl_opts(Endpoint, SSLOpts) ->
case is_ssl(Endpoint) of case is_ssl(Endpoint) of
true -> true ->
emqx_tls_lib:to_client_opts(SSLOpts); %% force enable ssl
emqx_tls_lib:to_client_opts(SSLOpts#{enable => true});
false -> false ->
[] []
end. end.