Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  After last update 30th April in the SDK Python we are gettiing this error SSL error "ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:809)".

    Posted 05-02-2025 11:17
    Edited by Edwin Moreno Ramos 05-04-2025 22:04

    Hi Community , We need your help about this issue that is happening since the last update in the SDK python with the PureCloudPlatformClientV2.

    After the last update on 30th April we are getting the  SSL error "ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:809)". As you can see in the image below:



    Now, in the python package, genesys have changed the api_client.py file which looks to us is causing the main issue . Inside this .py file, mainly the get_client_credentials_token() and call_api() methods. The first method we are using to generate the access token by passing it the client id and client secret while the second method is being used in most the Apis to call the required Apis by passing the access token to it.

    Doing some investigation the team also found specifically  where is the issue in the code in the latest PureCloudPlatformClientV2(release 227.0.0). Please see below:

    It's the high-lighted code below in PureCloudPlatformClientV2/configuration.py:                                                                                                                                      def create_mtls_or_ssl_context(self):
            if self.ssl_context is None:  # set_mtls_contents() or set_mtls_certificates() were not called.
    ssl_context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)                                                                                                                                                                                                                                                                                                                              If looking at ssl.py below:

     

    image

     

    The expected parameter for ssl.create_default_context should be:  purpose=ssl.Purpose.SERVER_AUTH.                                                               Using ssl.Purpose.CLIENT_AUTH is wrong and thus causing the above error we are getting from PureCloudPlatformClientv2.



    Please Could you please help to let us know the changes that we need to make in our code to work with these new changes or let us know if the  latest code version is faulty and need to be fixed.

    Thanks


    #PlatformSDK

    ------------------------------
    Edwin Moreno Ramos
    ------------------------------



  • 2.  RE: After last update 30th April in the SDK Python we are gettiing this error SSL error "ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:809)".

    Posted 05-05-2025 05:35

    Hello,

    I'll notify the SDK team about this.

    This is possibly coming from a miss on our side. Do you have the issue with version 227.0.0 only? Or was it already faulty with version 226.0.0?

    I'll update this post once SDK team takes a look and provides an analysis.

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 3.  RE: After last update 30th April in the SDK Python we are gettiing this error SSL error "ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:809)".

    Posted 05-05-2025 05:35

    Hi @Edwin Moreno Ramos

    Thanks for poniting the issue. We are troubleshooting the problem and hopefully come back with a root cause and fix for this.



    ------------------------------
    Venkata Hemanth Dogiparthi
    Manager, Software Engineering
    ------------------------------



  • 4.  RE: After last update 30th April in the SDK Python we are gettiing this error SSL error "ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:809)".

    Posted 05-05-2025 09:26

    Hi Dears, yes the issue just began to happen since the last version 227.0.0 released the last April 30th , so in the version 226.0.0 was working correctly.
    I will be waiting for your feedback when the issue is fixed.

    Thanks in advance!!!



    ------------------------------
    Edwin Moreno Ramos
    ------------------------------



  • 5.  RE: After last update 30th April in the SDK Python we are gettiing this error SSL error "ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:809)".

    Posted 05-06-2025 15:30

    Hi, guys ,do you have a possible dead line to fix the issue found?

    Thanks



    ------------------------------
    Edwin Moreno Ramos
    ------------------------------



  • 6.  RE: After last update 30th April in the SDK Python we are gettiing this error SSL error "ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:809)".

    Posted 05-12-2025 02:17

    Hello,

    The fix should be in the last version (228.0.0). Please let us know if this solves the problem.

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------