2016-07-19 77 views
0

我使用谷歌開發者工具和答案複製爲捲曲請求curl:爲什麼我會得到空迴應?

enter image description here

當我在我的Linux服務器上運行的捲曲,我從服務器

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 

任何想法爲什麼?

+0

嗨Yarek,我添加了請求的詳細輸出和我有同樣的問題。你使用的是什麼操作系統和OpenSSL版本?我使用OpenSSL 1.0.1f在Mint 17.2(Ubuntu 14.04)上。我想知道這是否相關。不久將嘗試RHEL和其他一些OpenSSL版本。我甚至嘗試過'openssl s_client -connect web-ast.dsi.cnrs.fr:443',無論我發送了什麼(假數據或有效的HTTP請求),連接都會關閉而不發送任何數據。 'wget'遭受同樣的問題,所以它不是捲曲相關的,很可能是OpenSSL。 – drew010

回答

0

-k,--insecure(SSL)此選項明確允許curl執行「不安全」SSL連接和傳輸。嘗試使用默認安裝的CA證書包來保證所有SSL連接的安全。這使得所有認爲「不安全」的連接都會失敗,除非使用-k,--insecure。

試試這個兄弟。

+0

不,那不是。 TLS交換髮生得很好,我早些時候嘗試了一堆東西,但它不是SSL問題。 – drew010

+0

我試過沒有成功! – yarek

+0

我嘗試在本地獲取成功內容。我不知道你爲什麼失敗:( –