」工欲善其事,必先利其器。「—孔子《論語.錄靈公》
首頁 > 程式設計 > 儘管禁用了驗證,但如何解決PHP捲曲中的SSL CA Cert \“問題?

儘管禁用了驗證,但如何解決PHP捲曲中的SSL CA Cert \“問題?

發佈於2025-03-24
瀏覽:238

How to Resolve \

Troubleshooting Ignored CURLOPT_SSL_VERIFYPEER in PHP CURL

Problem:

Users are encountering an issue where HTTPS requests using CURL raise a "Problem with the SSL CA cert" error, despite將curlopt_ssl_verifypeer和curlopt_ssl_verifyhost設置為false。

原因和解決方案:

Additionally:

CURLOPT_SSL_VERIFYHOST
    :
  • Set to 1 to check common name existence in the SSL peer certificate.

    Set to 2 to check common name existence並將其與提供的主機名匹配。
    • 建議的代碼:
    • 啟用驗證並指定CA證書文件:
  • Additional Notes:

Ensure that the CA certificate file is valid and accessible by the server.

The curl.cainfo setting in php.ini can also用於指定CA證書文件。

rename/etc/pki/nssdb to/etc/pki/nssdb.old to reset證書權限。
            
版本聲明 本文轉載於:1729379958如有侵犯,請聯繫[email protected]刪除
最新教學 更多>

免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。

Copyright© 2022 湘ICP备2022001581号-3