PHP CURL - curl 错误 35 : error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type

标签 php curl openssl

我想在 PHP 7.3.90 中发出 curl 请求

curl -V
curl 7.64.0 (x86_64-pc-linux-gnu) libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Release-Date: 2019-02-06
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL 

    $ch = curl_init();
    // 2. set the options, including the url
    curl_setopt($ch, CURLOPT_URL, "https://mydomain/get-token");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("App-Key: YOUR-KEY-HERE"));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

答案是
"cURL error 35: error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"

我对 curl 命令有同样的问题,我用
[system_default_sect]
MinProtocol = TLSv1.2
CipherString = DEFAULT@SECLEVEL=1

而不是
[system_default_sect]
MinProtocol = TLSv1.2
CipherString = DEFAULT@SECLEVEL=2


https://github.com/curl/curl/issues/4097OpenSSL v1.1.1 ssl_choose_client_version unsupported protocol

我必须使用哪个 curl 选项来解决此错误?

谢谢

最佳答案

我知道这个问题已经很老了,但是在使用一些旧的 coughhermescaugh api 时我遇到了同样的问题。
我也不想将整个系统的 seclevel 设置为 1。
您正在寻找的是以下内容:

 curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'DEFAULT@SECLEVEL=1');
只需将那段代码放入您的应用程序中,您就可以满足这个请求。
当然这不是最安全的方法,但是当 Api 没有正确设置时,您别无选择。

关于PHP CURL - curl 错误 35 : error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58342699/

相关文章:

php - Geckoboard 数据集 PHP cURL API

git - git history 是否会破坏使用 OpenSSL 加密的文件?

php - setlocale 在 PHP 中无效

php - 如何在 Android 中使用 firebase 向 1000 多个用户发送推送通知?

php - 图书馆数据库

php - 在 php 中获取 url 内容的安全性

spring - 通过curl路由上传到Amazon S3

php - 在 PHP 中如何获取 CSR 的公钥?

c++ - 如果多个不同的接受套接字使用相同的 OpenSSL 上下文会不会有问题?

php - 由于 PHP-FPM 监听队列,站点无法访问,CPU 达到 100%