Zimbra-Community / python-zimbra

Core framework for easily sending requests to the Zimbra SOAP-API
BSD 2-Clause "Simplified" License
63 stars 26 forks source link

Disable SSL Verification #28

Closed surfer190 closed 4 years ago

surfer190 commented 4 years ago

I want to allow for the communication client to receive a ssl context instead of using the existing one. Thereby allowing unverified SSL communication which is useful for development and testing.

Is there another method I should bo looking at to achieve this?

        import ssl

        ctx = ssl.create_default_context()
        ctx.check_hostname = False
        ctx.verify_mode = ssl.CERT_NONE

        server_request = ur.urlopen(
            self.url,
            request.get_request().encode("utf-8"),
            self.timeout,
            context=ctx
        )
barrydegraaff commented 4 years ago

Will review your changes and test via https://github.com/Zimbra-Community/python-zimbra/pull/29