Skip to content

ssl.SSLError exceptions in test_poplib #76934

Closed

Description

@yarko
mannequin
BPO 32753
Nosy @tiran, @yarko, @bitdancer, @asvetlov, @methane
Superseder
  • bpo-32706: test_check_hostname() of test_ftplib started to fail randomly
  • Files
  • v3.7.0b1-test-failure.txt: terminal capture of test suite failure point.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-02-04.19:40:19.741>
    created_at = <Date 2018-02-02.23:07:56.483>
    labels = ['3.7', 'type-crash', 'expert-asyncio']
    title = 'ssl.SSLError exceptions in test_poplib'
    updated_at = <Date 2018-04-09.11:49:31.212>
    user = 'https://github.com/yarko'

    bugs.python.org fields:

    activity = <Date 2018-04-09.11:49:31.212>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-02-04.19:40:19.741>
    closer = 'christian.heimes'
    components = ['asyncio']
    creation = <Date 2018-02-02.23:07:56.483>
    creator = 'yarkot'
    dependencies = []
    files = ['47421']
    hgrepos = []
    issue_num = 32753
    keywords = []
    message_count = 4.0
    messages = ['311521', '311522', '311617', '315125']
    nosy_count = 5.0
    nosy_names = ['christian.heimes', 'yarkot', 'r.david.murray', 'asvetlov', 'methane']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '32706'
    type = 'crash'
    url = 'https://bugs.python.org/issue32753'
    versions = ['Python 3.7']

    Activity

    1. yarko commented on Feb 2, 2018

      yarkomannequin
      MannequinAuthor

      Just built v3.7.0b1, and have the following test hangs (see attached).

      My build is on Ubuntu 16.04; lsb_release -a output:

      LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
      Distributor ID: Ubuntu
      Description: Ubuntu 16.04.3 LTS
      Release: 16.04
      Codename: xenial

      My "usual" config / build process:

      $ make distclean
      $ ./configure --enable-shared --enable-loadable-sqlite-extensions --with-system-ffi --with-ensurepip=upgrade --enable-optimizations
      $ make -j

      I have been building 3.7 weekly, from master, and I've never seen anything like this before.

    2. added
      3.7 (EOL)
      type-crash
      on Feb 2, 2018
    3. yarko commented on Feb 2, 2018

      yarkomannequin
      MannequinAuthor

      ...also, my initial build (after inspecting git log) was from (as I usually do) master/HEAD;

      To check that this was indeed from v3.7.0b1 release, I distclean and checked out the v3.7.0b1 tag, and rebuilt. (Looks like same error / behavior).

    4. tiran commented on Feb 4, 2018

      @tiran
      Member

      It's a duplicate of bpo-32706. The new cert validation code causes the handshake to terminate properly. The old asyncore based test routine is not able to handle this correctly when the machine is under heavy load.

    5. methane commented on Apr 9, 2018

      @methane
      Member

      On Ubuntu 17.10 (OpenSSL 1.0.2g), this patch fixes test_poplib error.
      But I don't know this patch is right.

      $ git diff
      diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
      index 6abdc93879..d7a8857b05 100644
      --- a/Lib/test/test_poplib.py
      +++ b/Lib/test/test_poplib.py
      @@ -180,7 +180,8 @@ class DummyPOP3Handler(asynchat.async_chat):
                       elif err.args[0] == ssl.SSL_ERROR_EOF:
                           return self.handle_close()
                       # TODO: SSLError does not expose alert information
      -                elif "SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1]:
      +                elif ("SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1]
      +                        or "SSLV3_ALERT_CERTIFICATE_UNKNOWN" in err.args[1]):
                           return self.handle_close()
                       raise
                   except OSError as err:
    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)topic-asynciotype-crash

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions