cURL Error #:unable to set private key file: 'C:\...\cacert.pem' type PEM
cUrl verbose information:
* Trying xxx.xxx.xxx.xxx...
* TCP_NODELAY set
* Connected to api.domain.ext (xxx.xxx.xxx.xxx) port 443 (#0)
* ALPN, offering http/1.1
* unable to set private key file: 'C:\...\cacert.pem' type PEM
* Closing connection 0
Я что-то упустил? Как я могу решить? ОБНОВЛЕНИЕ
Я переместил cacert.pem в каталог php и удалил CURLOPT_SSLCERT< /strong>, и теперь соединение закрывается позже, но я снова получаю OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054:
* Hostname api.domain.ext was found in DNS cache
* Trying xxx.xxx.xxx.xxx...
* TCP_NODELAY set
* Connected to api.domain.ext (xxx.xxx.xxx.xxx) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
CAfile: C:\Program Files (x86)\iis express\PHP\v7.0\cacert.pem
CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: C=**; ST=********; L=********; O=********; CN=********
* start date: Apr 12 03:17:12 2024 GMT
* expire date: Apr 12 03:16:12 2025 GMT
* subjectAltName: host "api.domain.ext" matched cert's "api.domain.ext"
* issuer: C=**; O=********; CN=********
* SSL certificate verify ok.
> POST /path HTTP/1.1
Host: api.domain.ext
Accept: */*
Accept-Encoding: deflate, gzip
Authorization: Basic ********:********
Message-Reference: SOME_STRING_VALUE
Message-Reference-Date: SOME_STRING_VALUE
content-type: application/json
Content-Length: 1602
Expect: 100-continue
* OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
* stopped the pause stream!
* Closing connection 0
Чтение этого API решения вызывает «Ошибка Curl: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054». Я также пробовал с другого сервера без чего-либо посередине, чтобы исключить проблемы с брандмауэрами, но то же самоеОБНОВЛЕНИЕ 30.10.2024
Я пытаюсь запустить пример запроса PHP cURL API с веб-сервера Windows/IIS
Вот код: [code] [/code] В моем [b]php.ini[/b] есть строка: [code]curl.cainfo="C:\...\cacert.pem" [/code] Но по какой-то причине мне пришлось добавить опцию [b]CURLOPT_SSLCERT[/b], потому что я получал: [code]OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 [/code] Я скачал файл [b]cacert.pem[/b] отсюда, как написано в этой заметке
Но я возьми это: [code]cURL Error #:unable to set private key file: 'C:\...\cacert.pem' type PEM cUrl verbose information: * Trying xxx.xxx.xxx.xxx... * TCP_NODELAY set * Connected to api.domain.ext (xxx.xxx.xxx.xxx) port 443 (#0) * ALPN, offering http/1.1 * unable to set private key file: 'C:\...\cacert.pem' type PEM * Closing connection 0 [/code] Я что-то упустил? Как я могу решить? [b]ОБНОВЛЕНИЕ[/b]
Я переместил cacert.pem в каталог php и удалил [b]CURLOPT_SSLCERT< /strong>, и теперь соединение закрывается позже, но я снова получаю OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054[/b]: [code]* Hostname api.domain.ext was found in DNS cache * Trying xxx.xxx.xxx.xxx... * TCP_NODELAY set * Connected to api.domain.ext (xxx.xxx.xxx.xxx) port 443 (#0) * ALPN, offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * successfully set certificate verify locations: CAfile: C:\Program Files (x86)\iis express\PHP\v7.0\cacert.pem CApath: none * SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256 * ALPN, server did not agree to a protocol * Server certificate: * subject: C=**; ST=********; L=********; O=********; CN=******** * start date: Apr 12 03:17:12 2024 GMT * expire date: Apr 12 03:16:12 2025 GMT * subjectAltName: host "api.domain.ext" matched cert's "api.domain.ext" * issuer: C=**; O=********; CN=******** * SSL certificate verify ok. > POST /path HTTP/1.1 Host: api.domain.ext Accept: */* Accept-Encoding: deflate, gzip Authorization: Basic ********:******** Message-Reference: SOME_STRING_VALUE Message-Reference-Date: SOME_STRING_VALUE content-type: application/json Content-Length: 1602 Expect: 100-continue
* OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 * stopped the pause stream! * Closing connection 0 [/code] Чтение этого API решения вызывает «Ошибка Curl: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054». Я также пробовал с другого сервера без чего-либо посередине, чтобы исключить проблемы с брандмауэрами, но то же самое[b]ОБНОВЛЕНИЕ 30.10.2024[/b]
со стороны сервера мне сказали следующее: [code]Error seems to be related to cipher suite presented by end-user
Please make sure user is sending a supported cipher
DH Groups P256 X25519 P384 FFDHE2048 FFDHE3072 FFDHE4096
Signature Algorithms RSA-PKCS1-SHA256 RSA-PSS-SHA256 ECDSA-SHA256 RSA-PKCS1-SHA384 RSA-PSS-SHA384 ECDSA-SHA384 RSA-PKCS1-SHA512 RSA-PSS-SHA512 ECDSA-SHA512 [/code] означает ли это, что мой сертификат не поддерживается?