【问题标题】:Application fails to verify SSL self-signed certificate on a BeagleBone Black running Debian应用程序无法在运行 Debian 的 BeagleBone Black 上验证 SSL 自签名证书
【发布时间】:2023-07-01 14:26:01
【问题描述】:

以下代码在我的 Ubuntu 机器(Python 2.7.6)上运行良好:

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

当我使用 Debian 在我的 BeagleboneBlack 中运行这段代码时,我得到了这个:

/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

certificate_path 具有自签名证书的路径。有人可以帮忙吗?

【问题讨论】:

标签: python debian ssl-certificate beagleboneblack self-signed


【解决方案1】:

经过更多搜索并尝试了一些替代方案,包括 cmets 中建议的替代方案,我找到了这个链接: https://serverfault.com/questions/549679/issued-certificate-not-yet-valid-with-wget

问题在于系统时钟设置为过去的日期

刚刚使用以下命令更正了日期,它对我有用:

$ ntpdate gps.ntp.br

【讨论】: