Can't verify some ssl certificates (e.g. imap.gmail.com)

Bug #1812667 reported by Daniel Axtens
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
isync (Debian)
Fix Released
Unknown
isync (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
Cosmic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * OpenSSL 1.1.1 performs SNI hostname verification, therefore hostname SSL context option must be set when establishing the connection, otherwise, validation of SNI certificates fail and thus resulting in lack of connectivity.

[Test Case]

 * use isync to connect to an SNI tls protected host, e.g. imap.gmail.com

[Regression Potential]

 * change is compatible with openssl versions shipped in bionic/cosmic-release
 * change is from upstream / tested in debian & disco
 * change improves security, and is compatible with deployed servers out there
 * hosts with certificates not matching their actual hostname will remain invalid/untrusted

[Additional info]
To install python & openssl 1.1.1 on Bionic you may enable and use the below silo, which will then exhibit the enforcement of SNI hostname verification.

sudo add-apt-repository ppa:ci-train-ppa-service/3473
sudo apt-get update

[Other Info]

 * original bug report

Hi,

I just upgraded to cosmic and have hit the issue described in debian bug #9065955 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906955 - mbsync won't connect to e.g. gmail because of SSL errors.

I downloaded 1.3.0-2 from Debian and it works. Would it be possible to backport the fix to Cosmic please? Bionic is unaffected.

Regards,
Daniel

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Bionic will be affected, when OpenSSL 1.1.1 is SRUed into Bionic via https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1797386

description: updated
Changed in isync (Ubuntu):
status: New → Fix Released
Changed in isync (Ubuntu Bionic):
status: New → In Progress
Changed in isync (Ubuntu Cosmic):
status: New → In Progress
description: updated
Changed in isync (Debian):
status: Unknown → Fix Released
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Daniel, or anyone else affected,

Accepted isync into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/isync/1.3.0-1ubuntu0.18.10.0 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in isync (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-cosmic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Daniel, or anyone else affected,

Accepted isync into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/isync/1.3.0-1ubuntu0.18.04.0 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in isync (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Using sample config from e.g. https://wiki.archlinux.org/index.php/Isync

ubuntu@enormous-maggot:~$ grep VERSION /etc/os-release
VERSION="18.10 (Cosmic Cuttlefish)"
VERSION_ID="18.10"
VERSION_CODENAME=cosmic
ubuntu@enormous-maggot:~$ dpkg-query -W isync
isync 1.3.0-1build1
(reverse-i-search)`isy': sudo apt install ^Cync/cosmic
ubuntu@enormous-maggot:~$ mbsync -V -l gmail -c test-mbsyncrc -a
Reading configuration file /home/ubuntu/.mbsyncrc
No channel or group named '-c' defined.
No channel or group named 'test-mbsyncrc' defined.
No channel or group named '-a' defined.
Channel gmail
Opening master store gmail-remote...
Resolving imap.gmail.com... ok
Connecting to imap.gmail.com (74.125.133.109:993)...
Opening slave store gmail-local...
SSL error connecting imap.gmail.com (74.125.133.109:993): self signed certificate

Upgrading to:
$ dpkg-query -W isync
isync 1.3.0-1ubuntu0.18.10.0

$ mbsync -V -l gmail -c test-mbsyncrc -a
Reading configuration file /home/ubuntu/.mbsyncrc
No channel or group named '-c' defined.
No channel or group named 'test-mbsyncrc' defined.
No channel or group named '-a' defined.
Channel gmail
Opening master store gmail-remote...
Resolving imap.gmail.com... ok
Connecting to imap.gmail.com (74.125.133.109:993)...
Opening slave store gmail-local...
Connection is now encrypted
Logging in...
Authenticating with SASL mechanism PLAIN...
IMAP command 'AUTHENTICATE PLAIN <authdata>' returned an error: NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)

And "connection is now encrypted" -> ssl coonection is established meaning SNI is now used correctly, and the (on purpose) invalid password is rejected by remote server.

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Bionic now:

$ dpkg-query -W isync libssl1.1
isync 1.3.0-1ubuntu0.18.04.0
libssl1.1:amd64 1.1.1-1ubuntu2.1~18.04.0

$ mbsync -V -l gmail -c test-mbsyncrc -a
Reading configuration file /home/ubuntu/.mbsyncrc
No channel or group named '-c' defined.
No channel or group named 'test-mbsyncrc' defined.
No channel or group named '-a' defined.
Channel gmail
Opening master store gmail-remote...
Resolving imap.gmail.com... ok
Connecting to imap.gmail.com (74.125.133.108:993)...
Opening slave store gmail-local...
Connection is now encrypted
Logging in...
Authenticating with SASL mechanism PLAIN...

again, encrypted connection is established now.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
tags: added: id-5c6152a1705f317c2d2dc663
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package isync - 1.3.0-1ubuntu0.18.10.0

---------------
isync (1.3.0-1ubuntu0.18.10.0) cosmic; urgency=medium

  * Cheerypick 1.3.0-2 patch to use SNI when connecting with SSL. LP:
    #1812667

 -- Dimitri John Ledkov <email address hidden> Fri, 14 Dec 2018 15:35:09 +1100

Changed in isync (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for isync has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package isync - 1.3.0-1ubuntu0.18.04.0

---------------
isync (1.3.0-1ubuntu0.18.04.0) bionic; urgency=medium

  * Cheerypick 1.3.0-2 patch to use SNI when connecting with SSL. LP:
    #1812667

 -- Dimitri John Ledkov <email address hidden> Fri, 14 Dec 2018 15:35:09 +1100

Changed in isync (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.