Skip to content

Allow providing custom ssl context#405

Closed
rhegner wants to merge 1 commit into
iMicknl:mainfrom
rhegner:enhancement/custom_ssl_context
Closed

Allow providing custom ssl context#405
rhegner wants to merge 1 commit into
iMicknl:mainfrom
rhegner:enhancement/custom_ssl_context

Conversation

@rhegner

@rhegner rhegner commented May 11, 2025

Copy link
Copy Markdown
Contributor

Connecting to my router I got a SSLV3_ALERT_HANDSHAKE_FAILURE. The root cause seems to be an incompatible cipher being used. See

This PR allows to create a SagemcomClient with a custom SSL context like this:

sslcontext = ssl._create_unverified_context()
sslcontext.set_ciphers("AES256-GCM-SHA384")
SagemcomClient(HOST, USERNAME, PASSWORD, ENCRYPTION_METHOD, verify_ssl=None, ssl_context=sslcontext)

Note that from a TCPConnector perspective, verify_ssl and ssl_context are mutually exclusive parameters. That's why I had to change the handling of verify_ssl slightly, to allow passing in None.

@rhegner

rhegner commented May 19, 2025

Copy link
Copy Markdown
Contributor Author

Turns out that this is not needed, see /docs/ssl-error.md

@rhegner rhegner closed this May 19, 2025
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