ssl - curl:为什么我得到空响应?

标签 ssl curl

我使用谷歌开发者工具并将答案复制为 curl 请求

enter image description here

当我在我的 Linux 服务器上运行 curl 时,我得到了来自服务器的空回复

curl 'https://web-ast.dsi.cnrs.fr/l3c/owa/personnel.liste?nom=&prenom=&code_labo=&p_dep=52&sec=&bap=&emptype=&nat_pers=&typ_pers=&organisme=&delegation=&ville=&p_i=0&p_nb_res=0' \
-H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,es;q=0.2,pl;q=0.2' \
-H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \
-H 'Cache-Control: max-age=0' -H 'Connection: keep-alive' \
--compressed

curl: (52) Empty reply from server

详细输出:

* Hostname was NOT found in DNS cache
*   Trying 193.52.36.99...
* Connected to web-ast.dsi.cnrs.fr (193.52.36.99) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, 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 AES256-SHA
* Server certificate:
*    subject: OU=Domain Control Validated; CN=web-ast.dsi.cnrs.fr
*    start date: 2013-10-21 00:00:00 GMT
*    expire date: 2016-10-20 23:59:59 GMT
*    subjectAltName: web-ast.dsi.cnrs.fr matched
*    issuer: C=NL; O=TERENA; CN=TERENA SSL CA
*    SSL certificate verify ok.
> GET /l3c/owa/personnel.liste?nom=&prenom=&code_labo=&p_dep=52&sec=&bap=&emptype=&nat_pers=&typ_pers=&organisme=&delegation=&ville=&p_i=0&p_nb_res=0 HTTP/1.1
> Host: web-ast.dsi.cnrs.fr
> Accept-Encoding: gzip, deflate, sdch, br
> Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,es;q=0.2,pl;q=0.2
> Upgrade-Insecure-Requests: 1
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
> Cache-Control: max-age=0
> Connection: keep-alive
> 
* SSLv3, TLS alert, Client hello (1):
* Empty reply from server
* Connection #0 to host web-ast.dsi.cnrs.fr left intact
curl: (52) Empty reply from server

知道为什么吗?

最佳答案

-k, --insecure (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered "insecure" fail unless -k, --insecure is used.

兄弟,试试这个。

关于ssl - curl:为什么我得到空响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38460424/

相关文章:

c++ - 使用 CPP REST SDK 忽略 CERTIFICATE_ERROR

ssl - Mailgun webhooks : "HTTPS certificate validation failure" after renewing SSL certificte

node.js - 如何使用nodejs发出子HTTP请求

php - 如何使用 php 安全地传递 paypal API 凭据(以及为什么这不被认为是安全的)

google-chrome - httpd-2.4.18 mod_http2 适用于 curl 和 nghttp 但不适用于浏览器

php - 使用 PHP 和 cURL PUT 文件(内容)

html - 在安全页面上嵌入不安全的 Flash 对象

rest - 通过 RESTful API 或反向代理使用 SSL?

ssl - 没有客户端身份验证的 ActiveMQ。客户端是否需要 keystore ?

java - JSON Jersey JAXB