Your message dated Mon, 19 Jan 2015 21:23:36 +0000
with message-id <e1ydjnm-0000oo...@franck.debian.org>
and subject line Bug#775780: fixed in python-astropy 0.4.2-2
has caused the Debian Bug report #775780,
regarding python-astropy: FTBS in current testing
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
775780: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775780
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: python-astropy
Version: 0.4.2-1
Severity: serious
Forwarded: https://github.com/astropy/astropy/issues/3306
Tags: patch pending upstream

After SSLv2 and SSLv3 were removed, python-astropy fails to build:

The errors are like

_________________ ERROR collecting astropy/vo/samp/__init__.py _________________
astropy/vo/samp/__init__.py:15: in <module>
>   from .hub import *
astropy/vo/samp/hub.py:33: in <module>
>       from .ssl_utils import SafeTransport, SecureXMLRPCServer
astropy/vo/samp/ssl_utils.py:26: in <module>
>       class HTTPSConnection(HTTPConnection):
astropy/vo/samp/ssl_utils.py:35: in HTTPSConnection
>                    ssl_version=ssl.PROTOCOL_SSLv3, strict=None):
E           AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

The applied patch will fix this; I will upload a new package soon.
>From 40d05e497bcbf7a43bfdab8d81cbb30b15f9537f Mon Sep 17 00:00:00 2001
From: Michael Droettboom <mdb...@gmail.com>
Date: Fri, 16 Jan 2015 09:58:27 -0500
Subject: [PATCH] Let Python choose the default SSL protocol for us.

---
 astropy/vo/samp/client.py            | 17 ++++++---------
 astropy/vo/samp/hub.py               | 19 +++++++---------
 astropy/vo/samp/hub_proxy.py         | 19 +++++++---------
 astropy/vo/samp/hub_script.py        | 28 +++++++++++++-----------
 astropy/vo/samp/integrated_client.py | 30 +++++++++++++-------------
 astropy/vo/samp/ssl_utils.py         | 42 +++++++++++++++++++++++-------------
 6 files changed, 81 insertions(+), 74 deletions(-)

diff --git a/astropy/vo/samp/client.py b/astropy/vo/samp/client.py
index 63cf2f6..63328fe 100644
--- a/astropy/vo/samp/client.py
+++ b/astropy/vo/samp/client.py
@@ -85,13 +85,13 @@ class SAMPClient(object):
         passed from the Hub end of the connection.
 
     ssl_version : int, optional
-        Which version of the SSL protocol to use. Typically, the server
-        chooses a particular protocol version, and the client must adapt to
-        the server's choice. Most of the versions are not interoperable with
-        the other versions. If not specified the default SSL version is
-        `ssl.PROTOCOL_SSLv23`. This version provides the most compatibility
-        with other versions Hub side. Other SSL protocol versions are:
-        `ssl.PROTOCOL_SSLv2`, `ssl.PROTOCOL_SSLv3` and `ssl.PROTOCOL_TLSv1`.
+        Which version of the SSL protocol to use. Typically, the
+        server chooses a particular protocol version, and the client
+        must adapt to the server's choice. Most of the versions are
+        not interoperable with the other versions. If not specified,
+        the default SSL version is taken from the default in the
+        installed version of the Python standard `ssl` library.  See
+        the `ssl` documentation for more information.
 
     callable : bool, optional
         Whether the client can receive calls and notifications. If set to
@@ -118,9 +118,6 @@ def __init__(self, hub, name=None, description=None, metadata=None,
         if description is not None:
             metadata["samp.description.text"] = description
 
-        if SSL_SUPPORT and ssl_version is None:
-            ssl_version = ssl.PROTOCOL_SSLv23
-
         self._metadata = metadata
 
         self._addr = addr
diff --git a/astropy/vo/samp/hub.py b/astropy/vo/samp/hub.py
index 6e01b4f..ba0044a 100644
--- a/astropy/vo/samp/hub.py
+++ b/astropy/vo/samp/hub.py
@@ -114,14 +114,14 @@ class SAMPHubServer(object):
         passed from the Hub end of the connection.
 
     ssl_version : int, optional
-        The ``ssl_version`` option specifies which version of the SSL protocol
-        to use. Typically, the server chooses a particular protocol version,
-        and the client must adapt to the server's choice. Most of the versions
-        are not interoperable with the other versions. If not specified the
-        default SSL version is `ssl.PROTOCOL_SSLv23`. This version provides
-        the most compatibility with other versions client side. Other SSL
-        protocol versions are: `ssl.PROTOCOL_SSLv2`, `ssl.PROTOCOL_SSLv3` and
-        `ssl.PROTOCOL_TLSv1`.
+        The ``ssl_version`` option specifies which version of the SSL
+        protocol to use. Typically, the server chooses a particular
+        protocol version, and the client must adapt to the server's
+        choice. Most of the versions are not interoperable with the
+        other versions. If not specified, the default SSL version is
+        taken from the default in the installed version of the Python
+        standard `ssl` library.  See the `ssl` documentation for more
+        information.
 
     web_profile : bool, optional
         Enables or disables the Web Profile support.
@@ -165,9 +165,6 @@ def __init__(self, secret=None, addr=None, port=0, lockfile=None,
         self._client_timeout = client_timeout
         self._pool_size = pool_size
 
-        if SSL_SUPPORT and ssl_version is None:
-            ssl_version = ssl.PROTOCOL_SSLv23
-
         self._web_profile = web_profile
         self._web_profile_server = None
         self._web_profile_callbacks = {}
diff --git a/astropy/vo/samp/hub_proxy.py b/astropy/vo/samp/hub_proxy.py
index 503c063..d055b50 100644
--- a/astropy/vo/samp/hub_proxy.py
+++ b/astropy/vo/samp/hub_proxy.py
@@ -78,14 +78,14 @@ def connect(self, hub=None, hub_params=None,
             certificate passed from the Hub end of the connection.
 
         ssl_version : int, optional
-            Which version of the SSL protocol to use. Typically, the server
-            chooses a particular protocol version, and the client must adapt
-            to the server's choice. Most of the versions are not interoperable
-            with the other versions. If not specified the default SSL version
-            is `ssl.PROTOCOL_SSLv3`. This version provides the most
-            compatibility with other versions server side. Other SSL protocol
-            versions are: `ssl.PROTOCOL_SSLv2`, `ssl.PROTOCOL_SSLv3` and
-            `ssl.PROTOCOL_TLSv1`.
+            Which version of the SSL protocol to use. Typically, the
+            server chooses a particular protocol version, and the
+            client must adapt to the server's choice. Most of the
+            versions are not interoperable with the other versions. If
+            not specified, the default SSL version is taken from the
+            default in the installed version of the Python standard
+            `ssl` library.  See the `ssl` documentation for more
+            information.
 
         pool_size : int, optional
             The number of socket connections opened to communicate with the
@@ -95,9 +95,6 @@ def connect(self, hub=None, hub_params=None,
         self._connected = False
         self.lockfile = {}
 
-        if SSL_SUPPORT and ssl_version is None:
-            ssl_version = ssl.PROTOCOL_SSLv3
-
         if hub is not None and hub_params is not None:
             raise ValueError("Cannot specify both hub and hub_params")
 
diff --git a/astropy/vo/samp/hub_script.py b/astropy/vo/samp/hub_script.py
index 343319b..90b006f 100644
--- a/astropy/vo/samp/hub_script.py
+++ b/astropy/vo/samp/hub_script.py
@@ -148,10 +148,14 @@ def hub_script(timeout=0):
                                "SSL protocol to use. Typically, the server chooses a particular "
                                "protocol version, and the client must adapt to the server's choice. "
                                "Most of the versions are not interoperable with the other versions. "
-                               "If not specified the default SSL version is SSLv23. This version "
-                               "provides the most compatibility with other versions client side. "
-                               "Other SSL protocol versions are: SSLv2, SSLv3 and TLSv1.",
-                               type=str, choices=["SSLv23", "SSLv2", "SSLv3", "TLSv1"], default="SSLv23")
+                               "If not specified the default SSL version is taken from the default in "
+                               "the Python standard `ssl` library for the version of Python that is "
+                               "installed. Other SSL protocol versions are: SSLv2, SSLv3, SSLv23, "
+                               "TLSv1, TLSv1_1, TLSv1_2 but not all of them may be available on all "
+                               "versions of Python.",
+                               type=str,
+                               choices=["SSLv23", "SSLv2", "SSLv3", "TLSv1", "TLSv1_1", "TLSv1_2"],
+                               default=None)
 
         parser.add_argument_group(ssl_group)
 
@@ -170,14 +174,14 @@ def hub_script(timeout=0):
             else:
                 options.cert_reqs = ssl.CERT_NONE
 
-            if options.ssl_version == "SSLv2":
-                options.ssl_version = ssl.PROTOCOL_SSLv2
-            elif options.ssl_version == "SSLv3":
-                options.ssl_version = ssl.PROTOCOL_SSLv3
-            elif options.ssl_version == "TLSv1":
-                options.ssl_version = ssl.PROTOCOL_TLSv1
-            else:
-                options.ssl_version = ssl.PROTOCOL_SSLv23
+            if options.ssl_version is not None:
+                if hasattr(ssl, 'PROTOCOL_' + options.ssl_version):
+                    options.ssl_version = getattr(
+                        ssl, 'PROTOCOL_' + options.ssl_version)
+                else:
+                    raise ValueError(
+                        "SSL protocol '{0}' not supported on this version of "
+                        "Python".format(options.ssl_version))
 
         if options.loglevel in ("OFF", "ERROR", "WARNING", "DEBUG", "INFO"):
             log.setLevel(options.loglevel)
diff --git a/astropy/vo/samp/integrated_client.py b/astropy/vo/samp/integrated_client.py
index d273ba8..14bd22e 100644
--- a/astropy/vo/samp/integrated_client.py
+++ b/astropy/vo/samp/integrated_client.py
@@ -68,13 +68,13 @@ class SAMPIntegratedClient(object):
         passed from the Hub end of the connection.
 
     ssl_version : int, optional
-        Which version of the SSL protocol to use. Typically, the server chooses
-        a particular protocol version, and the client must adapt to the
-        server's choice. Most of the versions are not interoperable with the
-        other versions. If not specified the default SSL version is
-        `ssl.PROTOCOL_SSLv23`. This version provides the most compatibility
-        with other versions Hub side. Other SSL protocol versions are:
-        `ssl.PROTOCOL_SSLv2`, `ssl.PROTOCOL_SSLv3` and `ssl.PROTOCOL_TLSv1`.
+        Which version of the SSL protocol to use. Typically, the
+        server chooses a particular protocol version, and the client
+        must adapt to the server's choice. Most of the versions are
+        not interoperable with the other versions. If not specified,
+        the default SSL version is taken from the default in the
+        installed version of the Python standard `ssl` library.  See
+        the `ssl` documentation for more information.
 
     callable : bool, optional
         Whether the client can receive calls and notifications. If set to
@@ -167,14 +167,14 @@ def connect(self, hub=None, hub_params=None,
             certificate passed from the Hub end of the connection.
 
         ssl_version : int, optional
-            Which version of the SSL protocol to use. Typically, the server
-            chooses a particular protocol version, and the client must adapt
-            to the server's choice. Most of the versions are not interoperable
-            with the other versions. If not specified the default SSL version
-            is `ssl.PROTOCOL_SSLv3`. This version provides the most
-            compatibility with other versions server side. Other SSL protocol
-            versions are: `ssl.PROTOCOL_SSLv2`, `ssl.PROTOCOL_SSLv3` and
-            `ssl.PROTOCOL_TLSv1`.
+            Which version of the SSL protocol to use. Typically, the
+            server chooses a particular protocol version, and the
+            client must adapt to the server's choice. Most of the
+            versions are not interoperable with the other versions. If
+            not specified, the default SSL version is taken from the
+            default in the installed version of the Python standard
+            `ssl` library.  See the `ssl` documentation for more
+            information.
 
         pool_size : int, optional
             The number of socket connections opened to communicate with the
diff --git a/astropy/vo/samp/ssl_utils.py b/astropy/vo/samp/ssl_utils.py
index 6b4785b..94acc16 100644
--- a/astropy/vo/samp/ssl_utils.py
+++ b/astropy/vo/samp/ssl_utils.py
@@ -32,7 +32,7 @@ class HTTPSConnection(HTTPConnection):
 
         def __init__(self, host, port=None, key_file=None, cert_file=None,
                      cert_reqs=ssl.CERT_NONE, ca_certs=None,
-                     ssl_version=ssl.PROTOCOL_SSLv3, strict=None):
+                     ssl_version=None, strict=None):
 
             HTTPConnection.__init__(self, host, port, strict)
 
@@ -47,12 +47,18 @@ def connect(self):
 
             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
             sock.connect((self.host, self.port))
-            sslconn = ssl.wrap_socket(sock, server_side=False,
-                                      certfile=self.cert_file,
-                                      keyfile=self.key_file,
-                                      cert_reqs=self.cert_reqs,
-                                      ca_certs=self.ca_certs,
-                                      ssl_version=self.ssl_version)
+            # We have to explicitly not pass the ssl_version to
+            # `ssl.wrap_socket` if it's None.
+            kwargs = {
+                'server_size': False,
+                'certfile': self.cert_file,
+                'keyfile': self.key_file,
+                'cert_reqs': self.cert_reqs,
+                'ca_certs': self.ca_certs,
+            }
+            if self.ssl_version is not None:
+                kwargs['ssl_version'] = self.ssl_version
+            sslconn = ssl.wrap_socket(sock, **args)
             self.sock = sslconn
 
     class HTTPS(HTTP):
@@ -64,7 +70,7 @@ class HTTPS(HTTP):
 
         def __init__(self, host='', port=None, key_file=None, cert_file=None,
                      cert_reqs=ssl.CERT_NONE, ca_certs=None,
-                     ssl_version=ssl.PROTOCOL_SSLv3):
+                     ssl_version=None):
 
             # provide a default host, pass the X509 cert info
 
@@ -97,7 +103,7 @@ class SafeTransport(xmlrpc.Transport):
 
     def __init__(self, key_file=None, cert_file=None,
                  cert_reqs=ssl.CERT_NONE, ca_certs=None,
-                 ssl_version=ssl.PROTOCOL_SSLv3, strict=None,
+                 ssl_version=None, strict=None,
                  use_datetime=0):
 
         xmlrpc.Transport.__init__(self, use_datetime)
@@ -151,10 +157,16 @@ def __init__(self, addr, key_file, cert_file, cert_reqs, ca_certs, ssl_version,
     def get_request(self):
         # override this to wrap socket with SSL
         sock, addr = self.socket.accept()
-        sslconn = ssl.wrap_socket(sock, server_side=True,
-                                  certfile=self.cert_file,
-                                  keyfile=self.key_file,
-                                  cert_reqs=self.cert_reqs,
-                                  ca_certs=self.ca_certs,
-                                  ssl_version=self.ssl_version)
+        # We have to explicitly not pass the ssl_version to
+        # `ssl.wrap_socket` if it's None.
+        kwargs = {
+            'server_side': True,
+            'certfile': self.cert_file,
+            'keyfile': self.key_file,
+            'cert_reqs': self.cert_reqs,
+            'ca_certs': self.ca_certs
+        }
+        if self.ssl_version is not None:
+            kwargs['ssl_version'] = self.ssl_version
+        sslconn = ssl.wrap_socket(sock, **kwargs)
         return sslconn, addr

--- End Message ---
--- Begin Message ---
Source: python-astropy
Source-Version: 0.4.2-2

We believe that the bug you reported is fixed in the latest version of
python-astropy, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 775...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ole Streicher <oleb...@debian.org> (supplier of updated python-astropy package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 19 Jan 2015 21:07:18 +0100
Source: python-astropy
Binary: python-astropy python3-astropy python-astropy-doc
Architecture: source amd64 all
Version: 0.4.2-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Astronomy Maintainers 
<debian-astro-maintain...@lists.alioth.debian.org>
Changed-By: Ole Streicher <oleb...@debian.org>
Description:
 python-astropy - Core functionality for performing astrophysics with Python
 python-astropy-doc - Core functionality for performing astrophysics with 
Python (doc)
 python3-astropy - Core functionality for performing astrophysics with Python3
Closes: 775780
Changes:
 python-astropy (0.4.2-2) unstable; urgency=medium
 .
   * Don't set defalt SSL protocol in vo/samp/client.py. Closes: #775780
Checksums-Sha1:
 754a12bfe28e434ca11409a0b3e2d9268f633f56 2550 python-astropy_0.4.2-2.dsc
 9ec3a5aa4508f02b1b3bedf11c62ea83b5628e10 11792 
python-astropy_0.4.2-2.debian.tar.xz
 41f707cb7a29361716b51e8c527d1406c3b7981a 2387998 
python-astropy_0.4.2-2_amd64.deb
 23b94752bf83cf8df8bc831067d5125cd3e9005b 2378158 
python3-astropy_0.4.2-2_amd64.deb
 4e69494e1bcc209d93ec3c997e1772438b334ab7 6183572 
python-astropy-doc_0.4.2-2_all.deb
Checksums-Sha256:
 cfb0b103440681662c6a37b43893bf3e823c7e3e6813b945cc53d90c7c10f245 2550 
python-astropy_0.4.2-2.dsc
 fa81ab81e7ed41f65ec24ec29225a23bf31cf3f68aac058d775e0838c845e100 11792 
python-astropy_0.4.2-2.debian.tar.xz
 fddd4565465e1f50ae9675ae63ca8d7aba75676829ff2603cd34219760c7cecb 2387998 
python-astropy_0.4.2-2_amd64.deb
 0dc1b576ccb55c35a45a9b8e9b045646a57e10d607d1064e7849a96115a3f5ac 2378158 
python3-astropy_0.4.2-2_amd64.deb
 7642eefa1832564ce5958a883adfef6d1fbc41bd35c7f6b251e9622703a908ec 6183572 
python-astropy-doc_0.4.2-2_all.deb
Files:
 9629facc53e77cdfb9a1ce44865b920b 2550 python optional 
python-astropy_0.4.2-2.dsc
 0322924fc87b718c73cbf627f0ad63a4 11792 python optional 
python-astropy_0.4.2-2.debian.tar.xz
 0c482f7ae6ac03b690f28bd857baa67c 2387998 python optional 
python-astropy_0.4.2-2_amd64.deb
 a0ebdf0a766f9caa09ffb65021d69a00 2378158 python optional 
python3-astropy_0.4.2-2_amd64.deb
 e9d352074c002b8f1254f52774ab1138 6183572 doc optional 
python-astropy-doc_0.4.2-2_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJUvWcMAAoJEHEVr9B3ENz3muMP/jePd9q0xEC6hlYAgmzVFjf+
YQvbM5Rs0OXtiOJ+mUFnaoC+Rqdbt/+T1dHHtkDHl5SiRs0W3cQHVzQ+w1DN7XKm
b1mWdXy8ILU7+CO2cNvYF73BN6ZfSC0PtBi1y2Zzbtfebk+0yD6FqvDhG9WS7zv5
Ob/QRpGKoDJea0FgU71DY8FiPK6LRcCbE7lbKyvKzfbBgaYxO5KYiRvBmk+1+RnY
Y5N+THH+jiWZ+N/d2vTviQpnpWtT5nXG/anwwJ0smtW4YM9CbOMdM/B/HIK76+si
JaGp2wcjXpLCt45KFeYP5f2NLZTeZOYew0uI2GKNgBfac7kdC1wZ3W8chaye2krR
wPK7+/09zYXOjbgPhkeJPbHKwwVHWMdFgZVOk72ViEtA++G9cFZzSNUfVT3nZoOr
nZhSdN2J0Oe1gJlmio5ZwHOpOe+YNojZBjaLJSiUoN9RQv0hJVldyFKSzvPHWf0d
rZhrYrrgDIzN6U6CrNdk5+2RHngHfnP7sqcHN5i3BRidXLkdunvFwKSxRQu8z5jg
T5QjYpUaXQBJXkhhMuRWsl+VmCdqmDZLn+GKfmhrzHHcvLBUkezyx4EejInRZRwX
UEyOhycI6ibRXn2qvwuXd6PJ6TnqtwKQmGCGWHEhgAPYxP3KOml2pbiJy2NAMEF0
o/kF5dRgWzytSo1O0CLT
=TO3n
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to