fix(bridge-s3): pass SSL options through `convert_certs/2`

This commit is contained in:
Andrew Mayorov 2024-06-06 16:28:25 +02:00
parent c17c788438
commit 8a85d7cb5a
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
2 changed files with 17 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{application, emqx_bridge_s3, [
{description, "EMQX Enterprise S3 Bridge"},
{vsn, "0.1.1"},
{vsn, "0.1.2"},
{registered, []},
{applications, [
kernel,

View File

@ -22,6 +22,10 @@
connector_examples/1
]).
-export([
pre_config_update/4
]).
%%-------------------------------------------------------------------------------------------------
%% `hocon_schema' API
%%-------------------------------------------------------------------------------------------------
@ -110,3 +114,15 @@ connector_example(put) ->
enable_pipelining => 1
}
}.
%% Config update
pre_config_update(Path, _Name, Conf = #{<<"transport_options">> := TransportOpts}, _ConfOld) ->
case emqx_connector_ssl:convert_certs(filename:join(Path), TransportOpts) of
{ok, NTransportOpts} ->
{ok, Conf#{<<"transport_options">> := NTransportOpts}};
{error, {bad_ssl_config, Error}} ->
{error, Error#{reason => <<"bad_ssl_config">>}}
end;
pre_config_update(_Path, _Name, Conf, _ConfOld) ->
{ok, Conf}.