test.test_httplib.HTTPSTest.test_networked_good_cert fails with OpenSSL 4.1.0

オープン
#160,823 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
77.8k
フォーク
37.7k
平均マージ
17時間 2分
マージ済み PR(30日)
699

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python/cpython のほかの issue

python/cpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。