Skip to content

Adjust SSL certificate-verification error strings for AWS-LC compat - #1751

Open
stewartsmith wants to merge 1 commit into
python-websockets:mainfrom
stewartsmith:aws-lc
Open

Adjust SSL certificate-verification error strings for AWS-LC compat#1751
stewartsmith wants to merge 1 commit into
python-websockets:mainfrom
stewartsmith:aws-lc

Conversation

@stewartsmith

Copy link
Copy Markdown

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.

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.
@aaugustin

Copy link
Copy Markdown
Member

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:

pip install tox
tox -e pyXY
pip install -r tests/requirements.txt
make
make tests
python -m pip install -r tests/requirements.txt
python setup.py build_ext --inplace
PYTHONPATH=src python -m unittest

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.

2 participants