"bad handshare: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')

NuclearSean
Conversationalist

"bad handshare: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')

Trying to perform an API on the Meraki network. My code works on my local machine but on the server, I get an error.

 

Here is the top portion of my code:

    starttime = time.time()
    dashboard = meraki.DashboardAPI(
        api_key=API_KEY,
        #base_url='https://api-mp.meraki.com/api/v0/',
        output_log=True)
 
    # Get list of organizations to which API key has access
    organizations = dashboard.organizations.getOrganizations()
 
It is the organizations line of code that is throwing the following error.
 
organizations = dashboard.organizations.getOrganizations()
2022-05-23 08:30:56       meraki:     INFO > GET https://api.meraki.com/api/v1/organizations
2022-05-23 08:30:56       meraki:  WARNING > organizations, getOrganizations - HTTPSConnectionPool(host='api.meraki.com', port=443): Max retries exceeded with url: /api/v1/organizations (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),)), retrying in 1 second
2022-05-23 08:30:57       meraki:     INFO > GET https://api.meraki.com/api/v1/organizations
2022-05-23 08:30:57       meraki:  WARNING > organizations, getOrganizations - HTTPSConnectionPool(host='api.meraki.com', port=443): Max retries exceeded with url: /api/v1/organizations (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),)), retrying in 1 second
Traceback (most recent call last):
 
  File "<ipython-input-4-2ae5f28e1df9>", line 1, in <module>
    organizations = dashboard.organizations.getOrganizations()
 
  File "C:\ProgramData\Anaconda3\lib\site-packages\meraki\api\organizations.py", line 21, in getOrganizations
    return self._session.get(metadata, resource)
 
  File "C:\ProgramData\Anaconda3\lib\site-packages\meraki\rest_session.py", line 283, in get
    response = self.request(metadata, 'GET', url, params=params)
 
  File "C:\ProgramData\Anaconda3\lib\site-packages\meraki\rest_session.py", line 187, in request
    raise APIError(metadata, response)
 
APIError: organizations, getOrganizations - None None, None
 
Any help on how to correct this issue would be greatly appreciated.
2 Replies 2
PhilipDAth
Kind of a big deal
Kind of a big deal

Does your server support making TLSv1.2 requests?

 

Does your server have a typical list of trusted CAs loaded, so it can trust the certificate on the Meraki API site?

Thank you very much for the response, PhilipDAth. I am still working through this. The issue does appear to be an issue with the server settings. The code works as expected on my local machine but not on the server. Tests with being able to communicate to Google via api fails as well. Working to have the network settings addressed.

 

If something else comes up, I will respond to this thread.

Get notified when there are additional replies to this discussion.