Search code examples
self-signed-certificatembsyncisync

Getting a self-signed certificate error with ProtonBridge and mbsync


I am attempting to setup isync with ProtonBridge and getting the following error:

SSL error connecting 127.0.0.1 (127.0.0.1:1143): self signed certificate

I am aware that this is the localhost, as such the certificate that we provide is self-signed. In any other email client, in Thunderbird for instance, it is a matter of confirming a security exception for port 1143 on 127.0.0.1. as detailed in step 5 here. What I quite did not figure out is how to do that in mbsync. Here is my .msyncrc:

IMAPStore someuser-remote
Host 127.0.0.1
Port 1143
User [email protected]
Pass protonbridgepassword
SSLType STARTTLS
CertificateFile /etc/ssl/certs/ca-certificates.crt

MaildirStore user-local
Path ~/Mail/
Inbox ~/Mail/INBOX
Subfolders Verbatim
Flatten .

Channel user
Master :user-remote:
Slave :user-local:
Create Both
Expunge Both
Patterns *
SyncState *

Tried with option SystemCertificates no to no avail as well. Here is the full log:

Reading configuration file /home/user/.mbsyncrc
C: 0/1  B: 0/0  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Channel user
Opening master store user-remote...
Resolving 127.0.0.1... ok
Connecting to 127.0.0.1 (127.0.0.1:1143)... 
Opening slave store user-local...
SSL error connecting 127.0.0.1 (127.0.0.1:1143): self signed certificate
C: 1/1  B: 0/0  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0

Solution

  • As mentioned on the comment above by @pusillanimous, I confirm that pointing directly to the cert at the protomail bridge works.

    So you simply need to to add the following to your .mbsyncrc

    CertificateFile ~/.config/protonmail/bridge/cert.pem