J'aimerais pouvoir lire les informations du certificat SSL avec CURL. A partir de la console Linux je reçois cet en-tête de réponse:Comment obtenir des informations de certificat SSL avec CURL en PHP?
GET https://www.google.com/ -ed
Cache-Control: private, max-age=0
Connection: close
Date: Sun, 20 Jun 2010 21:34:12 GMT
Server: gws
Content-Type: text/html; charset=ISO-8859-1
Expires: -1
Client-Date: Sun, 20 Jun 2010 21:34:18 GMT
Client-Peer: 66.102.13.106:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA
Client-SSL-Cert-Subject: /C=US/ST=California/L=Mountain View/O=Google Inc/CN=www.google.com
Client-SSL-Cipher: RC4-SHA
Client-SSL-Warning: Peer certificate not verified
Set-Cookie: PREF=ID=4d56960f6e3ad831:TM=1277069652:LM=1277069652:S=GF-w8Yc-_61NBzzJ; expires=Tue, 19-Jun-2012 21:34:12 GMT; path=/; domain=.google.com
Title: Google
X-XSS-Protection: 1; mode=block
Mais avec CURL l'en-tête est beaucoup plus courte:
HTTP/1.1 200 OK
Date: Sun, 20 Jun 2010 21:39:07 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=2d4fb1c933eebd09:TM=1277069947:LM=1277069947:S=6_TgGKzD0rM4IWms; expires=Tue, 19-Jun-2012 21:39:07 GMT; path=/; domain=.google.com
Server: gws
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked
Est-il possible d'obtenir ces informations, l'en-tête complète avec CURL ou une autre fonction PHP?
Donc, j'aurai besoin de la directive "allow_url_fopen" pour obtenir les informations du certificat? –
BTW: Pourquoi pensez-vous que cette connexion passe par un serveur proxy? Le curseur CURLOPT_HEADER a été défini. Mais l'en-tête ne semble pas être complet –
@Radek Suski Parce que google n'envoie pas de tels en-têtes 'Client- *'. – Artefacto