cURL / wget - SSLv3, handshake de TLS, CERT trava

4

Tenho problemas para me conectar a sites https usando cURL ou wget. Quando eu baixar de um https curl parece estar preso ao fazer o handshake TLS, CERT. O problema é independente do site (eu notei isso usando o github) e o wget está pendurado também (embora eu não tenha olhado para as saídas detalhadas lá).

$ curl -v --trace-time https://www.google.de
10:35:21.532822 * About to connect() to www.google.de port 443 (#0)
10:35:21.533091 *   Trying 209.85.148.147... connected
10:35:21.538666 * Connected to www.google.de (209.85.148.147) port 443 (#0)
10:35:21.539119 * SSLv3, TLS handshake, Client hello (1):
10:35:21.544129 * SSLv3, TLS handshake, Server hello (2):
10:35:21.544182 * SSLv3, TLS handshake, CERT (11):

Eu esperei 10 minutos, mas nada acontece. Eu estou usando o OSX Lion.

$curl --version
curl 7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM SSL libz

Eu não sei onde procurar ajuda, então eu ficaria feliz se você pudesse me dar algumas dicas.

Obrigado

    
por Moe 22.11.2011 / 10:41

2 respostas

3

curl -v --trace-time https://www.google.de

21:50:34.054955 * About to connect() to www.google.de port 443
21:50:34.056574 *   Trying 74.125.39.104... connected
21:50:34.104587 * Connected to www.google.de (74.125.39.104) port 443
21:50:34.313259 * successfully set certificate verify locations:
21:50:34.313349 *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
21:50:34.313758 * SSLv2, Client hello (1):
SSLv3, TLS handshake, Server hello (2):
SSLv3, TLS handshake, CERT (11):
SSLv3, TLS handshake, Server finished (14):
SSLv3, TLS handshake, Client key exchange (16):
SSLv3, TLS change cipher, Client hello (1):
SSLv3, TLS handshake, Finished (20):
SSLv3, TLS change cipher, Client hello (1):
SSLv3, TLS handshake, Finished (20):
SSL connection using RC4-SHA
21:50:34.418541 * Server certificate:
21:50:34.418631 *        subject: /C=US/ST=California/L=Mountain View/O=Google Inc/CN=www.google.com
21:50:34.418726 *        start date: 2011-10-26 00:00:00 GMT
21:50:34.418799 *        expire date: 2013-09-30 23:59:59 GMT
21:50:34.418902 * SSL: certificate subject name 'www.google.com' does not match target host name 'www.google.de'
21:50:34.419000 * Closing connection #0
21:50:34.419124 * SSLv3, TLS alert, Client hello (1):
curl: (51) SSL: certificate subject name 'www.google.com' does not match target host name 'www.google.de'

Parece que você não pode verificar o certificado porque está faltando o ca-bundle.crt. Isso pertence (no CentOS 5) ao openssl-rpm.

    
por 24.11.2011 / 22:20
2

Uma boa maneira de gerenciar essas coisas no Mac OS X / Darwin seria instalar um gerenciador de pacotes como o Homebrew ( link )

Dessa forma, ao instalar softwares como o cURL, você também obteria toda a lista de dependências ou apenas brew install openssl e o problema resolvido;)

    
por 12.02.2015 / 13:30

Tags