Skip to content

Conversation

@felixfontein
Copy link
Contributor

@felixfontein felixfontein commented Sep 26, 2024

An alternative to #124598 that's simpler. The additional data in cert3.pem shouldn't affect the tests.

Edit: doesn't work since PEM_cert_to_DER_cert doesn't like PEM comments.

@felixfontein
Copy link
Contributor Author

The additional data in cert3.pem shouldn't affect the tests.

Apparently it does:

ERROR: test_certificate_chain (test.test_ssl.TestPostHandshakeAuth.test_certificate_chain)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 4707, in test_certificate_chain
    expected_ee_cert = ssl.PEM_cert_to_DER_cert(f.read())
  File "/home/runner/work/cpython/cpython/Lib/ssl.py", line 1498, in PEM_cert_to_DER_cert
    raise ValueError("Invalid PEM encoding; must start with %s"
                     % PEM_HEADER)
ValueError: Invalid PEM encoding; must start with -----BEGIN CERTIFICATE-----

So PEM_cert_to_DER_cert doesn't like PEM with comments. I guess in that case #124598 is preferable.

@felixfontein felixfontein marked this pull request as draft September 26, 2024 13:43
@felixfontein felixfontein deleted the cert3-2 branch September 26, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant