IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Réseau Discussion :

curl ne reconnait pas mon certificat SSL


Sujet :

Réseau

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut curl ne reconnait pas mon certificat SSL
    bonjour,

    j'essaie d'envoyer, via curl, un fichier sur un serveur https. Tant que le serveur était en http, aucun soucis. Depuis qu'il est en https, impossible de faire fonctionner curl avec. Curl refuse de reconnaitre le certificat SSL du serveur. Il y a bien l'option '-k' dans curl, mais celle-ci désactive la validation ssl sur serveur, ce qui réduit à 0 la sécurité du ssl, et je voudrais donc l'éviter.

    Voilà d'abord le dit serveur, reconnu par défaut par firefox:


    J'y suis d'abord allé version naif:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    $ curl -v -u user:pass -T /path/to/source.xml https://server.domain/path/to/destination
    * About to connect() to serveur.domain port 443 (#0)
    *   Trying 193.190.249.140... connected
    * Connected to serveur.domain (193.190.249.140) port 443 (#0)
    * error setting certificate verify locations:
      CAfile: /etc/ssl/certs/ca-certificates.crt
      CApath: none
     
    * Closing connection #0
    curl: (77) error setting certificate verify locations:
      CAfile: /etc/ssl/certs/ca-certificates.crt
      CApath: none
    Visiblement, pas de certificat dispo. J'exporte donc le certificat de mon serveur (bouton exporter de firefox). J'obtiens alors un fichier .pem spécifique à serveur.domain, que j'utilise

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    $ curl  --cacert /tmp/server.domain -v -u user:pass -T /path/to/source.xml https://server.domain/path/to/destination
    * About to connect() to serveur.domain port 443 (#0)
    *   Trying 193.190.249.140... connected
    * Connected to serveur.domain (193.190.249.140) port 443 (#0)
    * successfully set certificate verify locations:
    *   CAfile: /tmp/serveur.domain
      CApath: none
    * SSLv2, Client hello (1):
    * SSLv3, TLS handshake, Server hello (2):
    * SSLv3, TLS handshake, CERT (11):
    * SSLv3, TLS alert, Server hello (2):
    * SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    * Closing connection #0
    curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    More details here: http://curl.haxx.se/docs/sslcerts.html
     
    curl performs SSL certificate verification by default, using a "bundle"
     of Certificate Authority (CA) public keys (CA certs). The default
     bundle is named curl-ca-bundle.crt; you can specify an alternate file
     using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
     the bundle, the certificate verification probably failed due to a
     problem with the certificate (it might be expired, or the name might
     not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
     the -k (or --insecure) option.
    j'essaie alors avec le .pem de l'autorité qui a signé mon serveur, de nouveau exporé avec firefox:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    $ curl --cacert /tmp/TERENASSLCA -v -u user:pass -T /path/to/source.xml https://serveur.domain/path/to/destination
    * About to connect() to serveur.domain port 443 (#0)
    *   Trying 193.190.249.140... connected
    * Connected to serveur.domain (193.190.249.140) port 443 (#0)
    * successfully set certificate verify locations:
    *   CAfile: /tmp/TERENASSLCA
      CApath: none
    * SSLv2, Client hello (1):
    * SSLv3, TLS handshake, Server hello (2):
    * SSLv3, TLS handshake, CERT (11):
    * SSLv3, TLS alert, Server hello (2):
    * SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    * Closing connection #0
    curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    More details here: http://curl.haxx.se/docs/sslcerts.html
     
    curl performs SSL certificate verification by default, using a "bundle"
     of Certificate Authority (CA) public keys (CA certs). The default
     bundle is named curl-ca-bundle.crt; you can specify an alternate file
     using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
     the bundle, the certificate verification probably failed due to a
     problem with the certificate (it might be expired, or the name might
     not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
     the -k (or --insecure) option.
    et pas plus de chance avec l'autorité racine
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    $ curl --cacert /tmp/AddTrustExternalCARoot -v -u user:pass -T /path/to/source.xml https://serveur.domain/path/to/destination
    * About to connect() to serveur.domain port 443 (#0)
    *   Trying 193.190.249.140... connected
    * Connected to serveur.domain (193.190.249.140) port 443 (#0)
    * successfully set certificate verify locations:
    *   CAfile: /tmp/AddTrustExternalCARoot
      CApath: none
    * SSLv2, Client hello (1):
    * SSLv3, TLS handshake, Server hello (2):
    * SSLv3, TLS handshake, CERT (11):
    * SSLv3, TLS alert, Server hello (2):
    * SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    * Closing connection #0
    curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    More details here: http://curl.haxx.se/docs/sslcerts.html
     
    curl performs SSL certificate verification by default, using a "bundle"
     of Certificate Authority (CA) public keys (CA certs). The default
     bundle is named curl-ca-bundle.crt; you can specify an alternate file
     using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
     the bundle, the certificate verification probably failed due to a
     problem with the certificate (it might be expired, or the name might
     not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
     the -k (or --insecure) option.
    un dernier essai en téléchargeant les certificate autorities depuis le site de curl:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    $ wget http://curl.haxx.se/ca/cacert.pem -O /tmp/fullcacert.pem     
    --11:28:07--  http://curl.haxx.se/ca/cacert.pem
               => `/tmp/fullcacert.pem'
    Resolving curl.haxx.se... 80.67.6.50
    Connecting to curl.haxx.se|80.67.6.50|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 252,513 (247K) [text/plain]
     
    100%[======================================================================================================================>] 252,513        1.10M/s             
     
    11:28:07 (1.09 MB/s) - `/tmp/fullcacert.pem' saved [252513/252513]
     
    $ curl --cacert /tmp/fullcacert.pem -v -u user:pass -T /path/to/source.xml https://serveur.domain/path/to/destination
    * About to connect() to serveur.domain port 443 (#0)
    *   Trying 193.190.249.140... connected
    * Connected to serveur.domain (193.190.249.140) port 443 (#0)
    * successfully set certificate verify locations:
    *   CAfile: /tmp/fullcacert.pem
      CApath: none
    * SSLv2, Client hello (1):
    * SSLv3, TLS handshake, Server hello (2):
    * SSLv3, TLS handshake, CERT (11):
    * SSLv3, TLS alert, Server hello (2):
    * SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    * Closing connection #0
    curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    More details here: http://curl.haxx.se/docs/sslcerts.html
     
    curl performs SSL certificate verification by default, using a "bundle"
     of Certificate Authority (CA) public keys (CA certs). The default
     bundle is named curl-ca-bundle.crt; you can specify an alternate file
     using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
     the bundle, the certificate verification probably failed due to a
     problem with the certificate (it might be expired, or the name might
     not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
     the -k (or --insecure) option.
    Alors la question fondamentale, qu'est-ce que je rate dans la doc à ce sujet? Qu'est-ce qu'il me manque??
    Images attachées Images attachées  

Discussions similaires

  1. L'ordre Select ne reconnait pas mon TextBox
    Par tipa42 dans le forum Windows Forms
    Réponses: 3
    Dernier message: 18/05/2010, 03h48
  2. Réponses: 4
    Dernier message: 27/11/2009, 14h48
  3. Eclipse ne reconnait pas mon entity
    Par alexlevenere dans le forum JPA
    Réponses: 1
    Dernier message: 15/11/2009, 20h36
  4. avast ne reconnait pas mon virus
    Par s-ehtp dans le forum Sécurité
    Réponses: 3
    Dernier message: 29/09/2008, 22h59
  5. [REDHAT] ne reconnait pas mon disque dur
    Par sfamok dans le forum RedHat / CentOS / Fedora
    Réponses: 7
    Dernier message: 31/01/2007, 23h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo