Search code examples
pythondebianssl-certificatebeagleboneblackself-signed

Application fails to verify SSL self-signed certificate on a BeagleBone Black running Debian


The following code is working fine in my Ubuntu machine (Python 2.7.6):

r = requests.get(GET_URL, verify=certificate_path)

When I run this code in my BeagleboneBlack with Debian, I get this:

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:100:
InsecurePlatformWarning: A true SSLContext object is not available. This prevents 
urllib3 from configuring SSL appropriately and may cause certain SSL connections 
to fail.

For more information, see https://urllib3.readthedocs.org/en/latest/security.html
#insecureplatformwarning.   InsecurePlatformWarning

[Errno 1] _ssl.c:504: 
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

The certificate_path has the path to a self-signed certificate. Can anyone help?


Solution

  • After search more and try some alternatives, including the suggested ones in the comments, I found this link: https://serverfault.com/questions/549679/issued-certificate-not-yet-valid-with-wget

    The problem was the system clock set to a date in the past.

    Just corrected the date with the following command and it worked for me:

    $ ntpdate gps.ntp.br