[New-bugs-announce] [issue13218] test_ssl failures on Ubuntu 11.10

Nadeem Vawda report at bugs.python.org
Wed Oct 19 14:30:50 CEST 2011


New submission from Nadeem Vawda <nadeem.vawda at gmail.com>:

Since upgrading to Ubuntu 11.10, I've been getting the following failures in test_ssl:

    ======================================================================
    FAIL: test_protocol_sslv3 (test.test_ssl.ThreadedTests)
    Connecting to an SSLv3 server with various client options
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/def/Lib/test/test_ssl.py", line 1415, in test_protocol_sslv3
        try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False)
      File "/home/nadeem/code/src/cpython/def/Lib/test/test_ssl.py", line 1232, in try_protocol_combo
        ssl.get_protocol_name(server_protocol)))
    AssertionError: Client protocol SSLv23 succeeded with server protocol SSLv3!

    ======================================================================
    FAIL: test_protocol_tlsv1 (test.test_ssl.ThreadedTests)
    Connecting to a TLSv1 server with various client options
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/def/Lib/test/test_ssl.py", line 1433, in test_protocol_tlsv1
        try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv23, False)
      File "/home/nadeem/code/src/cpython/def/Lib/test/test_ssl.py", line 1232, in try_protocol_combo
        ssl.get_protocol_name(server_protocol)))
    AssertionError: Client protocol SSLv23 succeeded with server protocol TLSv1!

    ----------------------------------------------------------------------

and this (presumably related) failure in test_nntplib:

    ======================================================================
    ERROR: setUpClass (test.test_nntplib.NetworkedNNTP_SSLTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/def/Lib/test/test_nntplib.py", line 291, in setUpClass
        cls.server = cls.NNTP_CLASS(cls.NNTP_HOST, timeout=TIMEOUT, usenetrc=False)
      File "/home/nadeem/code/src/cpython/def/Lib/nntplib.py", line 1052, in __init__
        readermode=readermode, timeout=timeout)
      File "/home/nadeem/code/src/cpython/def/Lib/nntplib.py", line 344, in __init__
        self.getcapabilities()
      File "/home/nadeem/code/src/cpython/def/Lib/nntplib.py", line 380, in getcapabilities
        resp, caps = self.capabilities()
      File "/home/nadeem/code/src/cpython/def/Lib/nntplib.py", line 546, in capabilities
        resp, lines = self._longcmdstring("CAPABILITIES")
      File "/home/nadeem/code/src/cpython/def/Lib/nntplib.py", line 513, in _longcmdstring
        resp, list = self._getlongresp(file)
      File "/home/nadeem/code/src/cpython/def/Lib/nntplib.py", line 464, in _getlongresp
        resp = self._getresp()
      File "/home/nadeem/code/src/cpython/def/Lib/nntplib.py", line 437, in _getresp
        resp = self._getline()
      File "/home/nadeem/code/src/cpython/def/Lib/nntplib.py", line 425, in _getline
        if not line: raise EOFError
    EOFError

3.2 gives a different set of failures in test_ssl (with the same failure in test_nntplib):

    ======================================================================
    ERROR: test_constructor (test.test_ssl.ContextTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 82, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 345, in test_constructor
        ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv2)
      File "/home/nadeem/code/src/cpython/3.2/Lib/ssl.py", line 168, in __new__
        return _SSLContext.__new__(cls, protocol)
    ssl.SSLError: failed to allocate SSL context

    ======================================================================
    ERROR: test_protocol (test.test_ssl.ContextTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 82, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 356, in test_protocol
        ctx = ssl.SSLContext(proto)
      File "/home/nadeem/code/src/cpython/3.2/Lib/ssl.py", line 168, in __new__
        return _SSLContext.__new__(cls, protocol)
    ssl.SSLError: failed to allocate SSL context

    ======================================================================
    ERROR: test_session_stats (test.test_ssl.ContextTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 82, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 453, in test_session_stats
        ctx = ssl.SSLContext(proto)
      File "/home/nadeem/code/src/cpython/3.2/Lib/ssl.py", line 168, in __new__
        return _SSLContext.__new__(cls, protocol)
    ssl.SSLError: failed to allocate SSL context

    ======================================================================
    ERROR: test_echo (test.test_ssl.ThreadedTests)
    Basic test of an SSL client connecting to a server
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 82, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 1147, in test_echo
        context = ssl.SSLContext(protocol)
      File "/home/nadeem/code/src/cpython/3.2/Lib/ssl.py", line 168, in __new__
        return _SSLContext.__new__(cls, protocol)
    ssl.SSLError: failed to allocate SSL context

    ======================================================================
    ERROR: test_protocol_sslv2 (test.test_ssl.ThreadedTests)
    Connecting to an SSLv2 server with various client options
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 82, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 1256, in test_protocol_sslv2
        try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 1108, in try_protocol_combo
        client_context = ssl.SSLContext(client_protocol)
      File "/home/nadeem/code/src/cpython/3.2/Lib/ssl.py", line 168, in __new__
        return _SSLContext.__new__(cls, protocol)
    ssl.SSLError: failed to allocate SSL context

    ======================================================================
    ERROR: test_protocol_sslv3 (test.test_ssl.ThreadedTests)
    Connecting to an SSLv3 server with various client options
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 82, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 1317, in test_protocol_sslv3
        try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv2, False)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 1108, in try_protocol_combo
        client_context = ssl.SSLContext(client_protocol)
      File "/home/nadeem/code/src/cpython/3.2/Lib/ssl.py", line 168, in __new__
        return _SSLContext.__new__(cls, protocol)
    ssl.SSLError: failed to allocate SSL context

    ======================================================================
    ERROR: test_protocol_tlsv1 (test.test_ssl.ThreadedTests)
    Connecting to a TLSv1 server with various client options
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 82, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 1334, in test_protocol_tlsv1
        try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv2, False)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 1108, in try_protocol_combo
        client_context = ssl.SSLContext(client_protocol)
      File "/home/nadeem/code/src/cpython/3.2/Lib/ssl.py", line 168, in __new__
        return _SSLContext.__new__(cls, protocol)
    ssl.SSLError: failed to allocate SSL context

    ======================================================================
    FAIL: test_options (test.test_ssl.ContextTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 82, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/3.2/Lib/test/test_ssl.py", line 370, in test_options
        self.assertEqual(ssl.OP_ALL, ctx.options)
    AssertionError: 4095 != 16781311

    ----------------------------------------------------------------------

On 2.7, the failures are again different:

    ======================================================================
    ERROR: test_protocol_sslv2 (test.test_ssl.ThreadedTests)
    Connecting to an SSLv2 server with various client options
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 75, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 986, in test_protocol_sslv2
        try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True)
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 856, in try_protocol_combo
        ciphers="ALL", chatty=False)
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 808, in server_params_test
        s.connect((HOST, server.port))
      File "/home/nadeem/code/src/cpython/2.7/Lib/ssl.py", line 322, in connect
        self._real_connect(addr, False)
      File "/home/nadeem/code/src/cpython/2.7/Lib/ssl.py", line 305, in _real_connect
        self.ca_certs, self.ciphers)
    SSLError: _ssl.c:316: Invalid SSL protocol variant specified.

    ======================================================================
    FAIL: test_protocol_sslv3 (test.test_ssl.ThreadedTests)
    Connecting to an SSLv3 server with various client options
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 75, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 1028, in test_protocol_sslv3
        try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False)
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 870, in try_protocol_combo
        ssl.get_protocol_name(server_protocol)))
    AssertionError: Client protocol SSLv23 succeeded with server protocol SSLv3!

    ======================================================================
    FAIL: test_protocol_tlsv1 (test.test_ssl.ThreadedTests)
    Connecting to a TLSv1 server with various client options
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 75, in f
        return func(*args, **kwargs)
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 1042, in test_protocol_tlsv1
        try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv23, False)
      File "/home/nadeem/code/src/cpython/2.7/Lib/test/test_ssl.py", line 870, in try_protocol_combo
        ssl.get_protocol_name(server_protocol)))
    AssertionError: Client protocol SSLv23 succeeded with server protocol TLSv1!

    ----------------------------------------------------------------------

The failures were probably caused by Ubuntu upgrading from openssl-0.9.8 to
openssl-1.0.0 in 11.10 -- I've reproduced the failures on three different
Ubuntu 11.10 machines, and none of the buildbots are having this problem.

For reference, the list of changes between 0.9.8 and 1.0.0 (look for the section
"Changes between 0.9.8n and 1.0.0 [29 Mar 2010]"):

    http://www.openssl.org/news/changelog.html

----------
components: Extension Modules
messages: 145902
nosy: giampaolo.rodola, janssen, nadeem.vawda, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: test_ssl failures on Ubuntu 11.10
versions: Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13218>
_______________________________________


More information about the New-bugs-announce mailing list