cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Meraki API Camera Snapshot - Certificate verify failed

Highlighted
New here

Meraki API Camera Snapshot - Certificate verify failed

I have a script which takes a snapshot from a camera. The script works fine on my macbook, but not on my Ubuntu server 20.04. On the Ubuntu server I receive a "certificate verify failed" error.

 

I found a lot of information regarding a "certificate verify failed" error, but nothing worked so far.

Maybe there is a workaround with the Meraki API options or someone would know a general Python fix.

 

Any help would be really appreciated.

 

 

 

python3 meraki_get_camera_snapshot.py -i 15min
      meraki:     INFO > Meraki dashboard API session initialized with these parameters: {'version': '1.0.0', 'api_key': '************************************eae1', 'base_url': 'https://api.meraki.com/api/v1', 'single_request_timeout': 60, 'certificate_path': '', 'requests_proxy': '', 'wait_on_rate_limit': True, 'nginx_429_retry_wait_time': 60, 'action_batch_retry_wait_time': 60, 'retry_4xx_error': False, 'retry_4xx_error_wait_time': 60, 'maximum_retries': 2, 'simulate': False, 'be_geo_id': None, 'caller': None}
      meraki:  WARNING > camera, generateDeviceCameraSnapshot - HTTPSConnectionPool(host='api.meraki.com', port=443): Max retries exceeded with url: /api/v1/devices/Q2TV-5W5E-QC5Z/camera/generateSnapshot (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))), retrying in 1 second
      meraki:  WARNING > camera, generateDeviceCameraSnapshot - HTTPSConnectionPool(host='api.meraki.com', port=443): Max retries exceeded with url: /api/v1/devices/Q2TV-5W5E-QC5Z/camera/generateSnapshot (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))), retrying in 1 second
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket
    cnx.do_handshake()
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1915, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1647, in _raise_ssl_error
    _raise_current_error()
  File "/usr/lib/python3/dist-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 352, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 491, in wrap_socket
    raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])",)

 

 

 

Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.