
Estoy intentando abrir un sitio web con cURL como este:
$ curl -vH "Accept: application/json" https://www.rocketleaguereplays.com/api/replays/-1/
La salida es:
* Trying 104.24.114.83...
* Connected to www.rocketleaguereplays.com (104.24.114.83) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Unknown (21):
* TLSv1.2 (IN), TLS alert, Server hello (2):
* error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
Tengo el kernel de Linux 4.4.0 y la versión más reciente de cURL instalada:
$ curl -V
curl 7.47.1 (x86_64-pc-linux-gnu) libcurl/7.47.1 OpenSSL/1.0.2f zlib/1.2.8 c-ares/1.10.0 nghttp2/1.6.0
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM SSL libz TLS-SRP HTTP2 UnixSockets
¿Cómo puedo arreglar esto? En Ubuntu funciona bien con cURL y la misma URL.
Respuesta1
Básicamente,https://www.rocketleaguereplays.comutiliza cifrado obsoleto (SSL3), puede forzar a curl a conectarse a sitios inseguros como este usando el modificador -k (--insecure).
Prueba esto:
curl -kvH "Accept: application/json" https://www.rocketleaguereplays.com/api/replays/-1/
También puedes intentar usar el -3
también conocido como --sslv3
switch, sin embargo, si curl se creó sin soporte SSL3, entonces necesitas compilar tu propia versión de curl, habilitando SSL3.
EDITAR: El operador ha encontrado el problema.
Me confundí con el mensaje de error.
Este es un error en gentoo:
https://bugs.gentoo.org/show_bug.cgi?id=531540
Básicamente, cuando construyes openssl con el indicador bindist, la criptografía de curva elíptica está deshabilitada. Este sitio requiere criptografía de curva elíptica.
Cuando ejecuto esto, obtengo lo siguiente:
$ curl -vH "Accept: application/json" https://www.rocketleaguereplays.com/api/replays/-1/ * STATE: INIT => CONNECT handle 0x6000572d0; line 1090 (connection #-5000) * Added connection 0. The cache now contains 1 members * Trying 2400:cb00:2048:1::6818:7353... * STATE: CONNECT => WAITCONNECT handle 0x6000572d0; line 1143 (connection #0) * Connected to www.rocketleaguereplays.com (2400:cb00:2048:1::6818:7353) port 443 (#0) * STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x6000572d0; line 1240 (connection #0) * ALPN, offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * successfully set certificate verify locations: * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Client hello (1): * STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x6000572d0; line 1254 (connection #0) * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS change cipher, Client hello (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS change cipher, Client hello (1): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256 <---- [...]
Entonces mi rizo usa una curva elíptica en este sitio.