aboutsummaryrefslogtreecommitdiffstats
path: root/worker
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2024-05-01 00:11:40 +0200
committerRobin Jarry <robin@jarry.cc>2024-05-01 00:15:49 +0200
commit7b4c8f67eb5f8e3e943d72a78bdeb4194a68c61e (patch)
treebff9ce35d3607de139ae7a3ca9536d9ce730088b /worker
parent0798a428060d5a36fb60d08133f14f9939b245d1 (diff)
downloadaerc-7b4c8f67eb5f8e3e943d72a78bdeb4194a68c61e.tar.gz
imap: add imaps+insecure mode
When connecting through environments bypassing hostnames, like SSH tunnels, the certificate verification of the server will fail, making it impossible to connect, if plain IMAP has been disabled. Add handling for the insecure modifier to the imaps connection. Changelog-added: Add `imaps+insecure` to the available protocols, for connections that should ignore issues with certificate verification. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker')
-rw-r--r--worker/imap/connect.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/worker/imap/connect.go b/worker/imap/connect.go
index 6c704d35..01ba7801 100644
--- a/worker/imap/connect.go
+++ b/worker/imap/connect.go
@@ -57,6 +57,9 @@ func (w *IMAPWorker) connect() (*client.Client, error) {
}
}
case "imaps":
+ if w.config.insecure {
+ tlsConfig.InsecureSkipVerify = true
+ }
tlsConn := tls.Client(conn, tlsConfig)
c, err = client.New(tlsConn)
if err != nil {