python-boto needs to support SNI for OpenSSL 1.1.1

Bug #1815439 reported by Dimitri John Ledkov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-boto (Debian)
Fix Released
Unknown
python-boto (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 python-boto to connect to an SNI tls protected host, e.g. GCE google storage using legacy .boto

[Regression Potential]

 * change is compatible with pythons/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

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

Hello Dimitri, or anyone else affected,

Accepted python-boto into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-boto/2.44.0-1ubuntu2.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 python-boto (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-cosmic
Changed in python-boto (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Dimitri, or anyone else affected,

Accepted python-boto into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-boto/2.44.0-1ubuntu2.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.

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

Simple:

import boto
import gcs_oauth2_boto_plugin
boto.storage_uri('', 'gs').get_all_buckets()

Fails with:

/usr/lib/python2.7/dist-packages/boto/connection.pyc in _mexe(self, request, sender, override_num_retries, retry_handler)
   1028 raise BotoServerError(response.status, response.reason, body)
   1029 elif ex:
-> 1030 raise ex
   1031 else:
   1032 msg = 'Please report this exception as a Boto Issue!'

SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727

and takes a long time to timeout / possibly it retries many times.

$ dpkg-query -W python-boto
python-boto 2.44.0-1ubuntu2

upgrading

$ dpkg-query -W python-boto
python-boto 2.44.0-1ubuntu2.18.10.0

the call now succeeds very quickly.

In [6]: boto.storage_uri('ubuntu-foundations', 'gs').get_all_buckets(headers=header_values)
Out[6]:
[<Bucket: >,
 <Bucket: >,
 <Bucket: >,
 <Bucket: >]

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

Doing same test on bionic, but first unpacking libssl1.1 from the silo ppa, withough upgrading python-boto

$ sudo dpkg-deb -x ./libssl1.1_1.1.1-1ubuntu2.1~18.04.0_amd64.deb /

And getting the error:

$ dpkg-query -W python-boto
python-boto 2.44.0-1ubuntu2

SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)

With:
$ dpkg-query -W libssl1.1 python-boto
libssl1.1:amd64 1.1.1-1ubuntu2.1~18.04.0
python-boto 2.44.0-1ubuntu2.18.04.0

Things are fine, and i get the results back quickly.

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

This bug was fixed in the package python-boto - 2.44.0-1ubuntu2.18.10.0

---------------
python-boto (2.44.0-1ubuntu2.18.10.0) cosmic; urgency=medium

  * Cherrypick 2.44.0-1.1 patch to add SNI support. LP: #1815439

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

Changed in python-boto (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 python-boto 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 python-boto - 2.44.0-1ubuntu2.18.04.0

---------------
python-boto (2.44.0-1ubuntu2.18.04.0) bionic; urgency=medium

  * Cherrypick 2.44.0-1.1 patch to add SNI support. LP: #1815439

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

Changed in python-boto (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.