Get_client_credentials_token freeze

Hello,

When I execute a simple script getting the list of queues available, it freezes when authenticating using the following code :

apiclient = PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token('xxxxx','yyyyy')

The very same script works from my azure test server, but freeze from my prod server on-prem.

I got the following when interrupting the script :

^CTraceback (most recent call last):
  File "./getQueuesDetails.py", line 10, in <module>
    apiclient = PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token('xxxxx','yyyyy')
  File "/usr/local/lib/python3.6/site-packages/PureCloudPlatformClientV2/api_client.py", line 131, in get_client_credentials_token
    post_params=post_params, body=body);
  File "/usr/local/lib/python3.6/site-packages/PureCloudPlatformClientV2/api_client.py", line 631, in request
    body=body)
  File "/usr/local/lib/python3.6/site-packages/PureCloudPlatformClientV2/rest.py", line 229, in POST
    body=body)
  File "/usr/local/lib/python3.6/site-packages/PureCloudPlatformClientV2/rest.py", line 171, in request
    headers=headers)
  File "/usr/lib/python3.6/site-packages/urllib3/request.py", line 72, in request
    **urlopen_kw)
  File "/usr/lib/python3.6/site-packages/urllib3/request.py", line 150, in request_encode_body
    return self.urlopen(method, url, **extra_kw)
  File "/usr/lib/python3.6/site-packages/urllib3/poolmanager.py", line 324, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 315, in connect
    conn = self._new_conn()
  File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 162, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3.6/site-packages/urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)
KeyboardInterrupt

I have tried waiting for a long time, but it never ends up in timeout.

Hereafter the script I used:

#!/usr/bin/python3

import PureCloudPlatformClientV2
from PureCloudPlatformClientV2.rest import ApiException

region = PureCloudPlatformClientV2.PureCloudRegionHosts.eu_central_1
PureCloudPlatformClientV2.configuration.host = region.get_api_host()
print (PureCloudPlatformClientV2.configuration.host)
apiclient = PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token('xxxxx','yyyyy')
api_instance = PureCloudPlatformClientV2.RoutingApi(apiclient)
# Get list of queues
api_response = api_instance.get_routing_queues()
print(api_response)

There is no network restriction, except that I'm going outside through a proxy. The hosts are the same (RHEL 8), Python version are the same 3.6. SeLinux is disabled.

Any clue where I should look to troubleshoot that problem?

Thanks a lot.

Gilles.

Hello,

You can set the address of the proxy server in the SDK if you are connecting through a proxy server.
See Connect to a Proxy Server - Platform API Python SDK.

Regards,

It's supposed to be a transparent proxy, but your advice is the answer.

Thanks a lot.

Regards,

Gilles.