lexiforest / curl_cffi

Python binding for curl-impersonate fork via cffi. A http client that can impersonate browser tls/ja3/http2 fingerprints.
https://curl-cffi.readthedocs.io/
MIT License
2.52k stars 266 forks source link

certificate路径问题 #318

Closed Hanbaguiya closed 3 months ago

Hanbaguiya commented 6 months ago

在centos中报curl_cffi.requests.errors.RequestsError: Failed to perform, curl: (77) error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs. See https://curl.se/libcurl/c/libcurl-errors.html first for more details.此文件不存在于系统中 在SSL中查看默认路径为DefaultVerifyPaths(cafile='/etc/pki/tls/cert.pem', capath='/etc/pki/tls/certs', openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='/etc/pki/tls/cert.pem', openssl_capath_env='SSL_CERT_DIR', openssl_capath='/etc/pki/tls/certs')该文件存在于系统 from curl_cffi import Curl, CurlOpt c = Curl() c.setopt(CurlOpt.CAINFO, "cacert.pem") 设置也无效 路径中不包含中文

Hanbaguiya commented 6 months ago

Curl中默认路径为cert包的cert.pem

lexiforest commented 3 months ago

用的是什么版本啊?看起来是比较老的版本,最近的版本已经改用 certifi 了

Hanbaguiya commented 3 months ago

用的是什么版本啊?看起来是比较老的版本,最近的版本已经改用 certifi 了

用的最新版本 好像是代理的协议不对