From 484cecb16062d553b88522bb5e42e76c05013d52 Mon Sep 17 00:00:00 2001 From: Andriy Sedinin Date: Mon, 6 May 2024 13:01:18 +0300 Subject: [PATCH] add tls_options to smtp:socket:connect/5 --- src/gen_smtp_client.erl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gen_smtp_client.erl b/src/gen_smtp_client.erl index 0e585cc..ce09ab3 100644 --- a/src/gen_smtp_client.erl +++ b/src/gen_smtp_client.erl @@ -850,13 +850,14 @@ connect(Host, Options) -> undefined -> []; Other -> Other end, - SockOpts = [binary, {packet, line}, {keepalive, true}, {active, false} | AddSockOpts], - Proto = + SockOpts0 = [binary, {packet, line}, {keepalive, true}, {active, false} | AddSockOpts], + {Proto, SockOpts} = case proplists:get_value(ssl, Options) of true -> - ssl; + %% for ssl need to add tls_options to connect (see smtp_socket:connect/5) + {ssl, lists:append(SockOpts0, proplists:get_value(tls_options, Options, []))}; _ -> - tcp + {tcp, SockOpts0} end, Port = case proplists:get_value(port, Options) of