SSL com cURL vs. sudo cURL, wget, openssl

1

Ao usar o cURL como root, tudo funciona bem:

$ sudo curl -vvv  https://test.example.org/ > /dev/null
* Connected to test.example.org (1.2.3.4) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*   subject: CN=test.example.org,O=organization,L=location,ST=state,C=country
*   start date: Okt 26 06:58:41 2015 GMT
*   expire date: Okt 24 06:58:41 2020 GMT
*   common name: test.example.org
*   issuer: [email protected],CN=example.org,O=organization,L=location,ST=state,C=country

Como usuário normal, isso não acontece:

$ curl -vvv  https://test.example.org/ > /dev/null
* Connected to test.example.org (1.2.3.4) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* Server certificate:
*   subject: CN=test.example.org,O=organization,L=location,ST=state,C=country
*   start date: Okt 26 06:58:41 2015 GMT
*   expire date: Okt 24 06:58:41 2020 GMT
*   common name: test.example.org
*   issuer: [email protected],CN=example.org,O=organization,L=location,ST=state,C=country
* NSS error -8172 (SEC_ERROR_UNTRUSTED_ISSUER)
* Peer's certificate issuer has been marked as not trusted by the user.
* Closing connection 0
curl: (60) Peer's certificate issuer has been marked as not trusted by the user.
More details here: http://curl.haxx.se/docs/sslcerts.html

Também wget funciona como esperado e openssl se conecta sem erros:

$ openssl s_client -connect test.example.org:443 -servername test.example.org  -showcerts < /dev/null
...
    Verify return code: 0 (ok)

Estou trabalhando com o Fedora 22, o certificado de CA foi importado copiando-o para / etc / pki / ca-trust / source / anchors / e executando update-ca-trust (como root) posteriormente.

Depois de importar o arquivo CA para o Firefox e o Chrome, o site também é carregado sem erros.

O servidor está executando o apache 2.4, com as seguintes opções no arquivo vhost:

    SSLEngine on
    SSLProtocol All -SSLv2 -SSLv3
    SSLCertificateFile /etc/pki/certs/test.exmple.org.crt
    SSLCertificateKeyFile /etc/pki/private/test.exmple.org.key
    SSLCACertificateFile /etc/pki/certs/exmple.org.crt

Não tenho certeza se isso é um problema de configuração do servidor ou um problema de curvatura. Então, desculpe, se essa pergunta se encaixar melhor em uma comunidade diferente.

Alguma idéia?

    
por Jens 27.10.2015 / 10:13

0 respostas

Tags