test.test_httplib.HTTPSTest.test_networked_good_cert fails with OpenSSL 4.1.0

Abierto
#160,823 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
56/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Start with test/test_httplib.py, especially HTTPSTest.test_networked_good_cert around the reported failing request, and read the linked OpenSSL issue for the certificate verification change. Determine how the test certificate and hostname interact with OpenSSL 4.1.0; done means the test correctly checks a valid certificate and passes with the changed OpenSSL behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

extension-modules topic-SSL type-bug
Bug report
======================================================================
ERROR: test_networked_good_cert (test.test_httplib.HTTPSTest.test_networked_good_cert)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.15/test/test_httplib.py", line 2247, in test_networked_good_cert
    h.request('GET', '/')
    ~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib/python3.15/http/client.py", line 1398, in request
    self._send_request(method, url, body, headers, encode_chunked)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.15/http/client.py", line 1444, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.15/http/client.py", line 1393, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.15/http/client.py", line 1153, in _send_output
    self.send(msg)
    ~~~~~~~~~^^^^^
  File "/usr/lib/python3.15/http/client.py", line 1097, in send
    self.connect()
    ~~~~~~~~~~~~^^
  File "/usr/lib/python3.15/http/client.py", line 1543, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
                                          server_hostname=server_hostname)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.15/ssl.py", line 469, in wrap_socket
    return self.sslsocket_class._create(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        sock=sock,
        ^^^^^^^^^^
    ...<5 lines>...
        session=session
        ^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.15/ssl.py", line 1103, in _create
    self.do_handshake()
    ~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.15/ssl.py", line 1434, in do_handshake
    self._sslobj.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'self-signed.pythontest.net'. (_ssl.c:1147)

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

Apparently this is caused by an intentional change in OpenSSL, see https://github.com/openssl/openssl/issues/33420.

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Lenguaje dominante
Python
Estrellas
77.8k
Forks
37.7k
Merge medio
17 h 2 min
PR fusionados (30 d)
699

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de python/cpython

Todos los issues de python/cpython

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.