[unix] 발행자의 권한을 로컬에서 확인할 수 없습니다

wget 또는 curl을 사용하여 https URL을 열 수 없습니다.

$ wget https://www.python.org
--2015-04-27 17:17:33--  https://www.python.org/
Resolving www.python.org (www.python.org)... 103.245.222.223
Connecting to www.python.org (www.python.org)|103.245.222.223|:443... connected.
ERROR: cannot verify www.python.org's certificate, issued by "/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA":
  Unable to locally verify the issuer's authority.
To connect to www.python.org insecurely, use '--no-check-certificate'.

$ curl https://www.python.org
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

이것은 CentOS 5.5에서 wget 1.12 및 curl 7.30.0을 사용하고 있습니다. 로컬 인증서 저장소에 문제가있는 것 같지만 여기서 진행하는 방법을 모르겠습니다. 어떤 아이디어?

업데이트 : openssl 패키지를 0.9.8e-12.el5_4.6에서 0.9.8e-33.el5_11로 업그레이드 한 후 다른 오류가 발생합니다.

$ wget https://pypi.python.org
--2015-04-28 10:27:35--  https://pypi.python.org/
Resolving pypi.python.org (pypi.python.org)... 103.245.222.223
Connecting to pypi.python.org (pypi.python.org)|103.245.222.223|:443... connected.
ERROR: certificate common name "www.python.org" doesn't match requested host name "pypi.python.org".
To connect to pypi.python.org insecurely, use '--no-check-certificate'.



답변

문제는 서버 이름 표시에 대한 지원이 부족하다는 것입니다. 당신은 적어도 wget을 1.14 또는 컬 7.18.1이 필요 하고 당신은 위키 백과에 따르면, 적어도에는 OpenSSL 0.98f이 필요합니다 :

https://en.wikipedia.org/wiki/Server_Name_Indication#Implementation


답변

도커 이미지 (circleci / jdk8 : 0.1) 에서 https://excellmedia.dl.sourceforge.net/project/astyle/astyle/astyle%203.0.1/astyle_3.0.1_linux.tar.gz 와 비슷한 오류가 발생했습니다 . 1),

제 경우에는 인증서를 업그레이드하면 문제가 해결되었습니다.

sudo apt-get install ca-certificates


답변

wget1.14 이전 버전에서는 SAN (Subject Alternative Name) *을 지원하지 않습니다. PyPI는 인증서의 CN 대신 SAN을 사용하며 wget이 불일치를 막고 있습니다. wget을 업그레이드하면 문제가 해결됩니다.

* 또는 SNI (Server Name Indication)-여기에 어떤 것이 적용되는지 잘 모르겠습니다.

참고 문헌 :


답변

해결책 1 :

openssl s_client -connect whateversite.com:443 -debug

인증서 키를 가져 와서에 복사하십시오 /etc/ssl/certs.

$ wget https://www.python.org --ca-certificate=/etc/ssl/certsfile

안전하지 않은 방법으로 가고 싶다면 해결책 2를 시도하십시오.

해결책 2 :

$ wget https://www.python.org --no-check-certificate

또는 사용 Curl

$ curl https://www.python.org --insecure


답변

서버에서 시간을 업데이트하십시오. 잠시만이 문제가 발생할 수 있습니다!

확인 :

date

Redhat / CentOS 6/7

yum -y install ntpdate; /usr/sbin/ntpdate -u pool.ntp.org

우분투 / 데비안

apt-get -y install ntpdate; /usr/sbin/ntpdate -u pool.ntp.org


답변

echo “check_certificate = off”>> ~ / .wgetrc


답변