簡體   English   中英

SSL 錯誤 - 無法驗證第一個證書

[英]SSL Error - Unable to verify the first certificate

我們正在使用 nginx。 我正在嘗試在我的應用程序中使用 Postman 訪問 API 並且我無法驗證第一個證書問題

我已經配置了我的 ssl 密鑰如下

ssl_certificate      /etc/nginx/conf.d/ssl/******.crt;
ssl_certificate_key  /etc/nginx/conf.d/ssl/******.key;

我沒有任何中級證書。 我只提供了一份證書。

我的應用程序在其他瀏覽器活動上正常工作。 https 已啟用,瀏覽器觸發器上沒有警告。

任何指導將不勝感激

您需要使用 your.crt 的內容 + bunble.crt 的內容創建一個 new.crt 文件,並告訴 nginx 使用該新文件,問候並抱歉我的英語。

urllib.error.URLError: <urlopen error [ssl: certificate_verify_failed] certificate verify failed: unable to get local issuer (_ssl.c:1108)< div><div id="text_translate"><pre> import yfinance as yf</pre><p> msft = yf.Ticker("MSFT")</p><p> 微軟信息</p><p>我嘗試打印 msft.info 並得到 'urllib.error.URLError: &lt;urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] 證書驗證失敗:無法獲取本地頒發者證書 (_ssl.c:1108)' 錯誤。 我嘗試重新運行 Install Certificates.command 和 Update Sheet.command,但顯然它不起作用。 同樣在我重新運行它們之后,我得到了這個消息: 由於 EnvironmentError 無法安裝軟件包:[Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/證書 2021.5.30.dist 信息。</p><p> 任何建議我該如何解決?</p></div></urlopen>

[英]urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

urllib.error.URLError: <urlopen error [ssl: certificate_verify_failed] certificate verify failed: unable to get local issuer (_ssl.c:1076)< div><div id="text_translate"><p> 我在 python 代碼中遇到證書錯誤,如下在 docker 容器laudio/pyodbc中運行</p><pre> File "/usr/local/lib/python3.7/site-packages/fredapi/fred.py", line 131, in get_series root = self.__fetch_data(url) File "/usr/local/lib/python3.7/site-packages/fredapi/fred.py", line 64, in __fetch_data response = urlopen(url) File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open response = self._open(req, data) File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open '_open', req) File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(*args) File "/usr/local/lib/python3.7/urllib/request.py", line 1362, in https_open context=self._context, check_hostname=self._check_hostname) File "/usr/local/lib/python3.7/urllib/request.py", line 1321, in do_open raise URLError(err) urllib.error.URLError: &lt;urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)&gt;</pre><p> 我的證書是最新的</p><pre>root@8a03fe8175b7:/# pip install --upgrade certifi Requirement already up-to-date: certifi in /usr/local/lib/python3.7/site-packages (2020.4.5.1)</pre><p> 我也嘗試使用沒有幫助的<a href="https://stackoverflow.com/questions/15445981/how-do-i-disable-the-security-certificate-check-in-python-requests" rel="nofollow noreferrer">no_ssl_verification 解決方案</a>。</p><p> 另外,這個文件是空的,這意味着什么嗎? 在我的主機上它已滿</p><pre>root@2927b5836cfa:/# ls -alt /etc/ssl/certs/ca-certificates.crt -rw-r--r-- 1 root root 0 May 23 20:14 /etc/ssl/certs/ca-certificates.crt</pre><p> 來自容器中 python shell 的更多信息,我不知道這是否有幫助。 但是容器中沒有 /export 目錄:</p><pre> print(ssl.get_default_verify_paths()) DefaultVerifyPaths(cafile=None, capath=None, openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='/export/home/pb2/build/sb_0-35870562-1568195162.53/openssl-1.1.1d-el6-x86-64bit/ssl/cert.pem', openssl_capath_env='SSL_CERT_DIR', openssl_capath='/export/home/pb2/build/sb_0-35870562-1568195162.53/openssl-1.1.1d-el6-x86-64bit/ssl/certs')</pre><p> 你能給我一些想法來解決這個問題嗎?</p></div></urlopen>

[英]urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

相關問題 無法驗證第一個證書 urlopen 錯誤 [SSL: CERTIFICATE_VERIFY_FAILED] 證書驗證失敗:無法獲取本地頒發者證書 (_ssl.c:1056) <urlopen error [ssl: certificate_verify_failed] certificate verify failed: unable to get local issuer (_ssl.c:1108)></urlopen> 氣剎錯誤:urlopen錯誤[SSL:CERTIFICATE_VERIFY_FAILED]證書驗證失敗:無法獲取本地發行者證書 urllib.error.URLError: <urlopen error [ssl: certificate_verify_failed] certificate verify failed: unable to get local issuer (_ssl.c:1108)< div><div id="text_translate"><pre> import yfinance as yf</pre><p> msft = yf.Ticker("MSFT")</p><p> 微軟信息</p><p>我嘗試打印 msft.info 並得到 'urllib.error.URLError: &lt;urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] 證書驗證失敗:無法獲取本地頒發者證書 (_ssl.c:1108)' 錯誤。 我嘗試重新運行 Install Certificates.command 和 Update Sheet.command,但顯然它不起作用。 同樣在我重新運行它們之后,我得到了這個消息: 由於 EnvironmentError 無法安裝軟件包:[Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/證書 2021.5.30.dist 信息。</p><p> 任何建議我該如何解決?</p></div></urlopen> urllib.error.URLError: <urlopen error [ssl: certificate_verify_failed] certificate verify failed: unable to get local issuer (_ssl.c:1076)< div><div id="text_translate"><p> 我在 python 代碼中遇到證書錯誤,如下在 docker 容器laudio/pyodbc中運行</p><pre> File "/usr/local/lib/python3.7/site-packages/fredapi/fred.py", line 131, in get_series root = self.__fetch_data(url) File "/usr/local/lib/python3.7/site-packages/fredapi/fred.py", line 64, in __fetch_data response = urlopen(url) File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open response = self._open(req, data) File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open '_open', req) File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(*args) File "/usr/local/lib/python3.7/urllib/request.py", line 1362, in https_open context=self._context, check_hostname=self._check_hostname) File "/usr/local/lib/python3.7/urllib/request.py", line 1321, in do_open raise URLError(err) urllib.error.URLError: &lt;urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)&gt;</pre><p> 我的證書是最新的</p><pre>root@8a03fe8175b7:/# pip install --upgrade certifi Requirement already up-to-date: certifi in /usr/local/lib/python3.7/site-packages (2020.4.5.1)</pre><p> 我也嘗試使用沒有幫助的<a href="https://stackoverflow.com/questions/15445981/how-do-i-disable-the-security-certificate-check-in-python-requests" rel="nofollow noreferrer">no_ssl_verification 解決方案</a>。</p><p> 另外,這個文件是空的,這意味着什么嗎? 在我的主機上它已滿</p><pre>root@2927b5836cfa:/# ls -alt /etc/ssl/certs/ca-certificates.crt -rw-r--r-- 1 root root 0 May 23 20:14 /etc/ssl/certs/ca-certificates.crt</pre><p> 來自容器中 python shell 的更多信息,我不知道這是否有幫助。 但是容器中沒有 /export 目錄:</p><pre> print(ssl.get_default_verify_paths()) DefaultVerifyPaths(cafile=None, capath=None, openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='/export/home/pb2/build/sb_0-35870562-1568195162.53/openssl-1.1.1d-el6-x86-64bit/ssl/cert.pem', openssl_capath_env='SSL_CERT_DIR', openssl_capath='/export/home/pb2/build/sb_0-35870562-1568195162.53/openssl-1.1.1d-el6-x86-64bit/ssl/certs')</pre><p> 你能給我一些想法來解決這個問題嗎?</p></div></urlopen> SSL 證書驗證失敗:無法獲取本地頒發者證書 疑難解答“ssl證書驗證失敗”錯誤 Windows上的SSL:CERTIFICATE_VERIFY_FAILED錯誤 “SSL:CERTIFICATE_VERIFY_FAILED”Mac 上的錯誤
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM