pythonsoapssl-certificatezeep

SSL Error with Zeep Python Library when VPN is disconnected


I am currently using the Zeep Python library for my project and I’ve encountered an issue that I hope someone can help me with.

When I try to run my code without connecting to my company’s VPN, I get the following error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='ws-gateway-cert.xxx.com', port=443): Max retries exceeded with url: /services (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)')))

However, when I connect to the VPN, the code works perfectly fine. This is puzzling because other clients like Postman and SoapUI are able to run the same requests successfully even without the VPN connection.


        session = Session()
        session.trust_env = False
        session.mount('https://', Pkcs12Adapter(
            pkcs12_filename=r'C:\PROJECT\assets\cert.p12',
            pkcs12_password='****'))

        session.verify = False

        transport = Transport(session=session, )
        settings = Settings(strict=False, xml_huge_tree=True, xsd_ignore_sequence_order=True, force_https=False)

        self.vw_client = Client(
            wsdl=self.wsdl,
            transport=transport,
            plugins=[WsAddressingPlugin(address_url='ws://address'),
                     # LoggingPlugin()
                     ],
            settings=settings
        )


Solution

  • I downgrade python 3.11 to 3.9 and it is working with/without my company VPN