linux能访问http页面,无法访问https网页

linux能访问http页面,无法访问https网页

问题描述

centos6 设备比较老了,硬件时钟不准确,导致无论都无法访问https页面,例如使用 curl 、wget 、docekr login都不能正常访问。
网上都是说下载这个https://curl.haxx.se/ca/cacert.pem,但是没没有用,其实很简单,只需要同步下系统时间就好。

curl https://baidu.com 提示:

curl: (60) Peer's Certificate has expired.
More details here: http://curl.haxx.se/docs/sslcerts.html

wget https://baidu.com 提示:

错误: 无法验证 baidu.com 的由 “/C=US/O=DigiCert Inc/CN=DigiCert Secure Site Pro CN CA G3”

docker login xxx 提示:

Error response from daemon: Get https://cc.com/v2/: x509: certificate has expired or is not yet valid

解决办法

1.查看时间

uptime

2.安装 ntp ntpupdate

yum install ntp -y

3.设置同步

ntpdate cn.pool.ntp.org

4.访问测试

curl https://baidu.com
#可正常访问
posted @ 2021-08-30 08:48  tangshow  阅读(2294)  评论(0编辑  收藏  举报