Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #90 SSL Context verification purpose with client SSL authentication #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

udokmeci-eiq
Copy link

Fix #90 SSL Context verification purpose with client SSL authentication

Issue

When making HTTPS requests, the following error occurred:

urllib.error.URLError: <urlopen error Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:809)>

This issue was caused by an incorrect SSL context configuration, where ssl.Purpose.CLIENT_AUTH was used instead of ssl.Purpose.SERVER_AUTH.


Root Cause

  • ssl.Purpose.CLIENT_AUTH is intended for servers verifying client certificates, not for clients verifying a server’s certificate.
  • Since this is a client-side HTTPS request, it should use ssl.Purpose.SERVER_AUTH.

Solution

Updated the SSL context creation to use ssl.Purpose.SERVER_AUTH:

…te a client socket with a PROTOCOL_TLS_SERVER context
@eric-eclecticiq
Copy link
Contributor

Could you add a note in CHANGES.rst ?

Copy link

@jamesoc-eiq jamesoc-eiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Cannot Authenticate Server
3 participants