linux - wget出现Unable to establish SSL connection
阿神
阿神 2017-04-17 11:58:56
0
2
1003

错误情况:
wget下载libevent,出现以下问题
[root@localhost ~]# wget --no-check-certificate http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz --2014-10-26 00:10:02-- http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz Resolving cloud.github.com... 54.192.118.148, 54.230.117.187, 54.230.118.105, ... Connecting to cloud.github.com|54.192.118.148|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz [following] --2014-10-26 00:10:02-- https://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz Connecting to cloud.github.com|54.192.118.148|:443... connected. OpenSSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure Unable to establish SSL connection.

环境:
CentOS 6.5 64位
[root@localhost ~]# openssl s_client socket: Connection refused connect:errno=111
[root@localhost ~]# openssl version OpenSSL 1.0.1e-fips 11 Feb 2013 [root@localhost ~]# openssl version -a OpenSSL 1.0.1e-fips 11 Feb 2013 built on: Thu Oct 16 15:36:32 UTC 2014 platform: linux-x86_64 options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM OPENSSLDIR: "/etc/pki/tls" engines: rdrand dynamic

已google过,解决方法是加--no-check-certificate参数,但我已经加了,还是这样。
用curl -O -L http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz 则可以成功下载。
但我想知道出现这问题的原因及解决方法。

感谢。

阿神
阿神

闭关修行中......

全部回复(2)
Ty80

因为你后面的连接是HTTP,SSL握手自然也就失败了。

迷茫

有些网站不允许非浏览器方式获取文件,用加参数:
wget https://URL-TO-DOWNLOAD
--user-agent="Mozilla/5.0 (X11;U;Linux i686;en-US;rv:1.9.0.3) Geco/2008092416 Firefox/3.0.3"
--no-check-certificate
试试看

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板