Skip to content

SSL check error when executing a request with ApiClient  #176

@hazmforce

Description

@hazmforce

Description

Describe your issue here.

What type of issue is this? (place an x in one of the [ ])

  • [ x] bug
  • enhancement (feature request)
  • question
  • [x ] documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x ] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

we have lumapps tenant with vanity url different from of courser sites-ms.lumapps.com base host url

while trying to execute a query using a token generated from the browser console with connected session
api_info={
"base_url" : "https://sites-ms.lumapps.com"
}
client = BaseClient(token=token,api_info=api_info)
user= client.get_call('user/get',email=user_email)

the following python error is returned

Traceback (most recent call last):
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_transports\default.py", line 61, in map_httpcore_exceptions
yield
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_transports\default.py", line 179, in handle_request
status_code, headers, byte_stream, extensions = self._pool.handle_request(
File "D:\ProgramData\Anaconda3\lib\site-packages\httpcore_sync\connection_pool.py", line 230, in handle_request
response = connection.handle_request(
File "D:\ProgramData\Anaconda3\lib\site-packages\httpcore_sync\connection.py", line 99, in handle_request
self.socket = self._open_socket(timeout)
File "D:\ProgramData\Anaconda3\lib\site-packages\httpcore_sync\connection.py", line 130, in _open_socket
return self.backend.open_tcp_stream(
File "D:\ProgramData\Anaconda3\lib\site-packages\httpcore_backends\sync.py", line 144, in open_tcp_stream
return SyncSocketStream(sock=sock)
File "D:\ProgramData\Anaconda3\lib\contextlib.py", line 131, in exit
self.gen.throw(type, value, traceback)
File "D:\ProgramData\Anaconda3\lib\site-packages\httpcore_exceptions.py", line 12, in map_exceptions
raise to_exc(exc) from None
httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "lumappstest.py", line 23, in
user= client.get_call('user/get',email=user_email)
File "D:\ProgramData\Anaconda3\lib\site-packages\lumapps\api\base_client.py", line 427, in get_call
response = self._call(name_parts, params, body)
File "D:\ProgramData\Anaconda3\lib\site-packages\lumapps\api\base_client.py", line 357, in _call
verb, path, params = self._get_verb_path_params(name_parts, params)
File "D:\ProgramData\Anaconda3\lib\site-packages\lumapps\api\base_client.py", line 350, in _get_verb_path_params
endpoint, path = self._get_endpoint_and_path_from_discovery(tuple(name_parts))
endpoint = method_from_discovery(self.discovery_doc, name_parts)
File "D:\ProgramData\Anaconda3\lib\site-packages\lumapps\api\base_client.py", line 189, in discovery_doc
resp = self.client.get(url)
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_client.py", line 975, in get
return self.request(
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_client.py", line 747, in request
return self.send(
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_client.py", line 831, in send
response = self._send_handling_auth(
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_client.py", line 866, in _send_handling_auth
response = self._send_handling_redirects(
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_client.py", line 900, in _send_handling_redirects
response = self._send_single_request(request, timeout)
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_client.py", line 934, in _send_single_request
(status_code, headers, stream, extensions) = transport.handle_request(
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_transports\default.py", line 179, in handle_request
status_code, headers, byte_stream, extensions = self._pool.handle_request(
File "D:\ProgramData\Anaconda3\lib\contextlib.py", line 131, in exit
self.gen.throw(type, value, traceback)
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_transports\default.py", line 78, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)

Reproducible in:

lumapps-sdk version:

python version:

OS version(s):

Steps to reproduce:

api_info={
"base_url" : "https://sites-ms.lumapps.com"
}
client = BaseClient(token=token,api_info=api_info)
user= client.get_call('user/get',email=user_email)
2.
3.

Expected result:

What you expected to happen
to get the a successful data from the get_call query

Actual result:

What actually happened
File "D:\ProgramData\Anaconda3\lib\site-packages\httpx_transports\default.py", line 78, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)

Reproducible in:

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions