From 60258937688384f7a24d73291b9357f5ccdf2552 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Fri, 27 Dec 2024 16:51:22 -0300 Subject: [PATCH] net.smtp: fix crash when reconnecting with .encrypted=true (fix #23289) (#23290) --- vlib/net/smtp/smtp.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/net/smtp/smtp.v b/vlib/net/smtp/smtp.v index 2d6a8d36080678..87ed6b288e4679 100644 --- a/vlib/net/smtp/smtp.v +++ b/vlib/net/smtp/smtp.v @@ -88,7 +88,7 @@ pub fn (mut c Client) reconnect() ! { conn := net.dial_tcp('${c.server}:${c.port}') or { return error('Connecting to server failed') } c.conn = conn - if c.ssl { + if c.ssl || c.encrypted { c.connect_ssl()! } else { c.reader = io.new_buffered_reader(reader: c.conn)