Skip to content

Add parameter verify_ssl#76

Merged
Quentame merged 13 commits intoProtoThis:masterfrom
mib1185:ssl-validation
Oct 19, 2020
Merged

Add parameter verify_ssl#76
Quentame merged 13 commits intoProtoThis:masterfrom
mib1185:ssl-validation

Conversation

@mib1185
Copy link
Contributor

@mib1185 mib1185 commented Oct 18, 2020

Hi,
fix #48
SSL validation is default disabled to not break existing environments.
If ssl_validation=True an SynologyDSMRequestException is thrown in case of validation error with details like:

{'api': None, 'code': -1, 'reason': 'Unknown', 'details': 'SSLError = ("hostname \'192.168.1.2\' doesn\'t match either of \'my.domain.com\', \'sub.domain.com\'",)'}

@mib1185 mib1185 mentioned this pull request Oct 18, 2020
@Quentame Quentame changed the title add parameter ssl_validation (solves #48) Add parameter ssl_validation Oct 19, 2020
@Quentame Quentame self-requested a review October 19, 2020 07:09
Copy link
Collaborator

@Quentame Quentame left a comment

Choose a reason for hiding this comment

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

Can you just rename ssl_validation to verify_ssl, uselly this is the name we gave to this function.

HA and Synology Surveillance Station lib are doing the same

@mib1185 mib1185 requested a review from Quentame October 19, 2020 17:33
Copy link
Collaborator

@Quentame Quentame left a comment

Choose a reason for hiding this comment

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

Good work 👍

@Quentame
Copy link
Collaborator

Tests 🆗

@Quentame Quentame changed the title Add parameter ssl_validation Add parameter verify_ssl Oct 19, 2020
@Quentame Quentame merged commit 0803538 into ProtoThis:master Oct 19, 2020
@Quentame Quentame added this to the 1.0.0 milestone Oct 20, 2020
@Quentame Quentame added enhancement Hacktoberfest https://hacktoberfest.digitalocean.com/ hacktoberfest-accepted labels Oct 21, 2020
@mib1185 mib1185 deleted the ssl-validation branch October 25, 2020 17:41
mib1185 referenced this pull request in mib1185/python-synology Dec 19, 2020
* add parameter ssl_validation

* add parameter ssl_validation

* rename to verify_ssl

* rename to verify_ssl

* object property use_https not needed

* black

* VALID_SSL_VERIFICATION --> VALID_SSL_VERIFY

* disable_warnings on urllib only if not verify_ssl

* VALID_SSL_VERIFY --> VALID_VERIFY_SSL

* VALID_SSL --> VALID_HTTPS

* Add test

* black again

* Add test

Co-authored-by: Quentin POLLET <polletquentin74@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Hacktoberfest https://hacktoberfest.digitalocean.com/ hacktoberfest-accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No SSL validation

2 participants