Skip to content

test_ssl: test_pha_required_nocert() logs ResourceWarning #81706

Closed

Description

@vstinner
BPO 37525
Nosy @vstinner, @tiran
Superseder
  • bpo-37322: test_ssl: test_pha_required_nocert() emits a ResourceWarning
  • 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 2019-07-09.09:54:55.764>
    created_at = <Date 2019-07-09.09:36:10.877>
    labels = ['tests', '3.9']
    title = 'test_ssl: test_pha_required_nocert() logs ResourceWarning'
    updated_at = <Date 2019-07-09.09:54:55.756>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-07-09.09:54:55.756>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-07-09.09:54:55.764>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2019-07-09.09:36:10.877>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37525
    keywords = []
    message_count = 2.0
    messages = ['347532', '347534']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'christian.heimes']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '37322'
    type = None
    url = 'https://bugs.python.org/issue37525'
    versions = ['Python 3.9']

    Activity

    1. vstinner commented on Jul 9, 2019

      @vstinner
      MemberAuthor
      vstinner@apu$ ./python -u -m test test_ssl -v -m test_pha_required_nocert
      == CPython 3.9.0a0 (heads/master:110a47c4f4, Jul 8 2019, 23:52:00) [GCC 9.1.1 20190503 (Red Hat 9.1.1-1)]
      == Linux-5.1.15-300.fc30.x86_64-x86_64-with-glibc2.29 little-endian
      == cwd: /home/vstinner/python/master/build/test_python_24211
      == CPU count: 8
      == encodings: locale=UTF-8, FS=utf-8
      Run tests sequentially
      0:00:00 load avg: 0.70 [1/1] test_ssl
      test_ssl: testing with 'OpenSSL 1.1.1c FIPS  28 May 2019' (1, 1, 1, 3, 15)
                under 'Linux-5.1.15-300.fc30.x86_64-x86_64-with-glibc2.29'
                HAS_SNI = True
                OP_ALL = 0x80000054
                OP_NO_TLSv1_1 = 0x10000000
      test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ... Exception in thread Thread-2:
      Traceback (most recent call last):
        File "/home/vstinner/python/master/Lib/test/test_ssl.py", line 2299, in run
          msg = self.read()
        File "/home/vstinner/python/master/Lib/test/test_ssl.py", line 2276, in read
          return self.sslconn.read()
        File "/home/vstinner/python/master/Lib/ssl.py", line 1101, in read
          return self._sslobj.read(len)
      ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2560)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/vstinner/python/master/Lib/threading.py", line 938, in _bootstrap_inner
          self.run()
        File "/home/vstinner/python/master/Lib/test/test_ssl.py", line 2385, in run
          raise ssl.SSLError('tlsv13 alert certificate required')
      ssl.SSLError: ('tlsv13 alert certificate required',)
      /home/vstinner/python/master/Lib/threading.py:938: ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 54611), raddr=('127.0.0.1', 56442)>
        self.run()
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      ok

      Ran 1 test in 0.028s

      OK

      == Tests result: SUCCESS ==

      1 test OK.

      Total duration: 178 ms
      Tests result: SUCCESS

      More verbose output from Refleak buildbot:
      https://buildbot.python.org/all/#/builders/189/builds/87

      0:00:19 load avg: 4.17 [ 40/419] test_ssl passed
      beginning 6 repetitions
      123456
      Exception in thread Thread-242:
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2299, in run
          msg = self.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2276, in read
          return self.sslconn.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/ssl.py", line 1101, in read
          return self._sslobj.read(len)
      ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2560)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py", line 938, in _bootstrap_inner
          self.run()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2385, in run
          raise ssl.SSLError('tlsv13 alert certificate required')
      ssl.SSLError: ('tlsv13 alert certificate required',)
      /home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py:938: ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 59465), raddr=('127.0.0.1', 40888)>
        self.run()
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      Resource 'ipv6.google.com' is not available
      .Exception in thread Thread-492:
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2299, in run
          msg = self.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2276, in read
          return self.sslconn.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/ssl.py", line 1101, in read
          return self._sslobj.read(len)
      ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2560)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py", line 938, in _bootstrap_inner
          self.run()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2385, in run
          raise ssl.SSLError('tlsv13 alert certificate required')
      ssl.SSLError: ('tlsv13 alert certificate required',)
      /home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py:938: ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 60255), raddr=('127.0.0.1', 47488)>
        self.run()
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      Resource 'ipv6.google.com' is not available
      .Exception in thread Thread-742:
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2299, in run
          msg = self.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2276, in read
          return self.sslconn.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/ssl.py", line 1101, in read
          return self._sslobj.read(len)
      ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2560)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py", line 938, in _bootstrap_inner
          self.run()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2385, in run
          raise ssl.SSLError('tlsv13 alert certificate required')
      ssl.SSLError: ('tlsv13 alert certificate required',)
      /home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py:938: ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 42085), raddr=('127.0.0.1', 33886)>
        self.run()
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      Resource 'ipv6.google.com' is not available
      .Exception in thread Thread-992:
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2299, in run
          msg = self.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2276, in read
          return self.sslconn.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/ssl.py", line 1101, in read
          return self._sslobj.read(len)
      ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2560)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py", line 938, in _bootstrap_inner
          self.run()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2385, in run
          raise ssl.SSLError('tlsv13 alert certificate required')
      ssl.SSLError: ('tlsv13 alert certificate required',)
      /home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py:938: ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 51799), raddr=('127.0.0.1', 46198)>
        self.run()
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      Resource 'ipv6.google.com' is not available
      .Exception in thread Thread-1242:
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2299, in run
          msg = self.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2276, in read
          return self.sslconn.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/ssl.py", line 1101, in read
          return self._sslobj.read(len)
      ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2560)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py", line 938, in _bootstrap_inner
          self.run()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2385, in run
          raise ssl.SSLError('tlsv13 alert certificate required')
      ssl.SSLError: ('tlsv13 alert certificate required',)
      /home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py:938: ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 37723), raddr=('127.0.0.1', 52182)>
        self.run()
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      Resource 'ipv6.google.com' is not available
      .Exception in thread Thread-1492:
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2299, in run
          msg = self.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2276, in read
          return self.sslconn.read()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/ssl.py", line 1101, in read
          return self._sslobj.read(len)
      ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2560)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py", line 938, in _bootstrap_inner
          self.run()
        File "/home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/test/test_ssl.py", line 2385, in run
          raise ssl.SSLError('tlsv13 alert certificate required')
      ssl.SSLError: ('tlsv13 alert certificate required',)
      /home/buildbot/buildarea/3.x.cstratak-fedora.refleak/build/Lib/threading.py:938: ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 51575), raddr=('127.0.0.1', 37214)>
        self.run()
      ResourceWarning: Enable tracemalloc to get the object allocation traceback
      Resource 'ipv6.google.com' is not available
      .
    2. vstinner commented on Jul 9, 2019

      @vstinner
      MemberAuthor

      Duplicate of bpo-37322.

    3. 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.9 (EOL)end of lifetestsTests in the Lib/test dir

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions