Adjust SSL certificate-verification error strings for AWS-LC compat - #1751
Conversation
AWS-LC ssl.SSLCertVerificationError message differs from OpenSSL:
OpenSSL: "certificate verify failed: self signed certificate"
AWS-LC: "[SSL: CERTIFICATE_VERIFY_FAILED] CERTIFICATE_VERIFY_FAILED:\
self signed certificate (_ssl.c:1082)"
By adjusting the text being looked for to be the common substrings,
the tests work when Python is built with AWS-LC.
|
Hello, I'm OK with the concept. The same change must be applied in tests/trio/test_client.py, then I can merge the PR. I assume that you are packaging websockets for AWS Linux and that you're attempting to run the tests as part of your packaging toolchain. I understand why you want to do this, but be aware that you aren't running tests properly: if you were, you would have noticed that you needed to change tests for the trio implementation. This raises questions on whether it makes sense for you to run the tests at all. Here are a few options to run a decent subset of the test suite, from shortest to most explicit: |
Same rationale as 0cd2ef0: match only the substring common to OpenSSL and AWS-LC error messages.
Yes, it's for building python with AWS-LC on Amazon Linux, along with a pile of modules. The packaging for Now there's also the question of why tests passed for me... and I'll 100% blame the LLM answering the question of "how do I run tests for this" given my general ignorance of the Python packaging world. Anyway, thanks for the pointers and for merging the PR! |
|
I'll look into committing LLM-oriented documentation that explains (among other things) how to run tests 👍 Currently I have it only locally because the standards are not quite settled. |
AWS-LC ssl.SSLCertVerificationError message differs from OpenSSL:
OpenSSL: "certificate verify failed: self signed certificate"AWS-LC: "[SSL: CERTIFICATE_VERIFY_FAILED] CERTIFICATE_VERIFY_FAILED: self signed certificate (_ssl.c:1082)"By adjusting the text being looked for to be the common substrings, the tests work when Python is built with the AWS-LC cryptographic library instead of OpenSSL.