1. 程式人生 > >錯誤:60, 'SSL certificate problem: unable to get local issuer certificate'

錯誤:60, 'SSL certificate problem: unable to get local issuer certificate'

pycurl.error: (60, ‘SSL certificate problem: unable to get local issuer certificate’)

分別使用openssl檢視子網站可以發現:

[email protected]:/code# openssl s_client -showcerts -servername x.y.com -connect x.y.com:443
CONNECTED(00000003)
depth=0 C = CN, OU = \E6\B5\99\E6\B1\9F..., CN = x.y.com
verify error:num=20:unable to get local issuer certificate  # 錯誤
verify return:1
depth=0 C = CN, OU = \E6\B5\99\E6\B1\9F..., CN = x.y.com
verify error:num=21:unable to verify the first certificate  # 錯誤
verify return:1
---
Certificate chain
 0 s:/C=CN/OU=\xE6\xB5\x99\.../CN=x.y.com
   i:/C=cn/OU=V\xFD[\xB6z\x0ER\xA1`;\@/CN=z\x0ER\xA1u5[P\x8B\xC1Nf{\xA1t\x06N-_\xC3/description=\x00c\x00a\x001\x000\x000\x000\x000\x002
-----BEGIN CERTIFICATE-----
....
-----END CERTIFICATE-----
---
Server certificate
subject=/C=CN/OU=\xE6\xB5\x99\.../CN=x.y.com
issuer=/C=cn/OU=V\xFD[\xB6z\x0ER\xA1`;\@/CN=z\x0ER\xA1u5[P\x8B\xC1Nf{\xA1t\x06N-_\xC3/description=\x00c\x00a\x001\x000\x000\x000\x000\x002
---
No client certificate CA names sent
---
SSL handshake has read 1664 bytes and written 419 bytes
Verification error: unable to verify the first certificate
---
New, SSLv3, Cipher is AES128-SHA
Server public key is 1024 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : AES128-SHA
    Session-ID: 9B731F3393...
    Session-ID-ctx:
    Master-Key: 670854BA6747BDF1...
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 1800 (seconds)
    TLS session ticket:
    0000 - 4b 08 17 c5 99 1f fb e3-08 9b 73 ba 5a 51 a7 de   K.........s.ZQ..
    0010 - cf d3 6c c5 ec 97 52 a0-30 82 f9 6a 85 94 47 2f   ..l...R.0..j..G/
    .....

    Start Time: 1531963197
    Timeout   : 7200 (sec)
    Verify return code: 21 (unable to verify the first certificate)
    Extended master secret: no
---
^C

p7b格式:以樹狀展示證書鏈(certificate chain),同時也支援單個證書,不含私鑰。

 # 檢視p7b證書。
 ~ openssl pkcs7 -inform DER -outform PEM -in certificate.p7b -print_certs
 # 匯出p7b證書。
 ~ openssl pkcs7 -inform DER -outform PEM -in certificate.p7b -print_certs > certificate_bundle.cer

curl的 -k/–insecure引數:

# curl也會通過驗證伺服器的證書來證明伺服器宣告的身份,如果驗證失敗curl將拒絕和這個伺服器連線,可以使用引數--insecure(-k)忽略伺服器不能被驗證。
# 更多關於伺服器證書驗證以及ca cert bundles可以參讀SSLCERTS文件(https://curl.haxx.se/docs/sslcerts.html)。
curl.setopt(pycurl.SSL_VERIFYPEER, False)  # equivalent to curl's --insecure

弊端:

  • 一旦伺服器端需要驗證證書,那麼所有訪問都將失敗!

相關推薦

錯誤60, 'SSL certificate problem: unable to get local issuer certificate'

pycurl.error: (60, ‘SSL certificate problem: unable to get local issuer certificate’) 分別使用openssl檢視子網站可以發現: [email protected

curl: (60) SSL certificate problem: unable to get local issuer certificate 錯誤

並且 分享 mpp pub all csdn fec work ble 今天同事做微信分享時,碰到如下SSL certificate problem: unable to get local issuer certificate。的錯誤信息。此問題的出現是由於沒有配置信任的

[PHP] curl: (60) SSL certificate problem: unable to get local issuer certificate

art src 授權 targe 解決 href lan ini san 對接微信授權的時候提示這個錯誤 從https://curl.haxx.se/ca/cacert.pem下載cacert.pem 在 php.ini中修改位置(curl.cainfo)如下: 重啟後問

php curl: (60) SSL certificate problem: unable to get local issuer certificate

我艹,我必須要先吐槽一下,我的 php 基礎知識實在是無語了. 我本地用的是 wampserver 開發環境,有多少人找這個問題是在 php 目錄找 php.ini 的.也就是類似以下的這幾個目錄 我這個傻逼就是改的這個裡面的 php.ini ,我找了一晚上這個問題啊

CURL error 60: SSL certificate problem: unable to get local issuer certificate

php5.6以上的版本會出現這種問題 解決辦法: (1) 訪問https://curl.haxx.se/docs/caextract.html,下載最新日期的cacert.pem (2) 在php.ini檔案新增兩行內容 curl.cainfo=

php SSL certificate problem: unable to get local issuer certificate

param response clas function -type span head urn content 加上 curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE); 就可以了 百度語音的demo: <?php

OSS上傳圖片時報錯:SSL certificate problem: unable to get local issuer certificate

php在curl的時候報此錯誤: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcur

PHP CURL GET HTTPS報錯SSL certificate problem: unable to get local issuer certificate

請求HTTP 使用php curl獲取http資源,不會報錯。 如下: <?php // 建立curl資源 $ch = curl_init(); // 設定url curl_setopt($ch, CURLOPT_URL, "baidu.com"); // 將Trans

PHP通過cURL訪問https時出現SSL certificate problem: unable to get local issuer certificate的解決方法

PHP通過cURL訪問https時出現SSL certificate problem: unable to get local issuer certificate的解決方法:只要設定以下兩個屬性就可以解決。 將 CURLOPT_SSL_VERIFYPEER 設定為 fal

PHPcURL error 60: SSL certificate unable to get local issuer certificate

導致該問題的原因在於沒有配置curl.cainfo,該配置位於php.ini中。 解決方案: 1)下載cacert.pem https://curl.haxx.se/ca/cacert.pem 2)配置php.ini [curl] ; A default value for

PHP出現SSL certificate: unable to get local issuer certificate的解決辦法

當本地curl需要訪問https時,出現SSL certificate: unable to get local issuer certificate錯誤資訊 解決辦法: 到http://curl.haxx.se/ca/cacert.pem下載pem檔案,並將檔案拷貝到D:\phpStudy

安裝npm包的時候出現unable to get local issuer certificate錯誤解決辦法

我本地的npm是通過node.js安裝包安裝之後來的,在安裝有些npm包的時候很正常,但是當我安裝superagent時出錯了,具體的錯誤資訊如下: npm ERR! Windows_NT 6.1.7601 npm ERR! argv "H:\\e\\Pr

Shell curl 命令報錯(60) SSL certificate problem: self signed certificate

curl 命令向伺服器傳送 https 請求 [email protected]53c79d8a7095:~# curl --header "PRIVATE-TOKEN: Nf1kK4MeF4fPMo7d4jY2" https://172.16.0.168/api

npm install總是報錯unable to verify the first certificate(無法驗證第一證書)

解決方法一: 取消ssl驗證:npm config set strict-ssl false 如果還沒成功,則將npm源更換為國內映象:npm config set registry http://registry.cnpmjs.org/ npm config set registr

mysql鏈接錯誤2003 can't connect to mysql server on 10038

option tcp/ip connect ons default 文件 port utf tcp 出現這個錯誤原因是端口號不是3306。 打開D:\Program Files\MySQL\MySQL Server 5.5 \my.ini文件,當然還有其他的.ini的文件

解決django.db.utils.OperationalError: unable to open database file

所在 git 目的 use 項目 文件 itl 報錯 log 這是一個從GitHub上下載的,一個網站項目的源碼。想要在自己的電腦上運行,期間過程相當曲折,不過至此終於是完成了。 1.安裝過程: python2->virtualenv->django1.9.8

npm 報錯unable to verify the first certificate

HR script view 國內鏡像 number onf statistic lse sdn npm總是報錯:unable to verify the first certificate 原創 2017年09月30日 11:06:10 https://blog.csd

Redis錯誤(error) MISCONF Redis is configured to save RDB snapshots, but it is currently not able...

今天執行redis命令:move key22 2 時,報如下錯誤: (error) MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Comman

報錯資訊 Fatal error: Uncaught Smarty: unable to write file 原因 系統時間與正常時間不同步 造成頁面訪問有問題

報錯資訊: Fatal error: Uncaught --> Smarty: unable to write file E:\GEM\App\Home\View_c\390df9d00aeacf16a4730ca0161bd6187d14c18e_0.file.header.html

selenium學習過程中的坑message: no such element: Unable to locate element:

selenium使用過程中的坑 使用class標籤定位時報錯: message: no such element: Unable to locate element: {"method":"class name" 在測試過程中,定位一個驗證碼圖片時,由於執行速度過快,瀏