https不起作用但http工作正常

时间:2014-01-31 21:56:03

标签: http https

当我尝试从互联网上下载文件时,我发现同样的链接下载失败了https但是成功用http。

e.g。

 wget https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear4/fileSequence0.ts
--2014-01-31 16:01:05--  https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear4/fileSequence0.ts
Resolving devimages.apple.com.edgekey.net (devimages.apple.com.edgekey.net)... 23.73.64.225
Connecting to devimages.apple.com.edgekey.net (devimages.apple.com.edgekey.net)|23.73.64.225|:443... connected.
ERROR: The certificate of ‘devimages.apple.com.edgekey.net’ is not trusted.
ERROR: The certificate of ‘devimages.apple.com.edgekey.net’ hasn't got a known issuer.

但如果我将https更改为http,它可以正常工作:

wget https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear4/fileSequence0.ts
--2014-01-31 16:01:05--  https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear4/fileSequence0.ts
Resolving devimages.apple.com.edgekey.net (devimages.apple.com.edgekey.net)... 23.73.64.225
Connecting to devimages.apple.com.edgekey.net (devimages.apple.com.edgekey.net)|23.73.64.225|:443... connected.
ERROR: The certificate of ‘devimages.apple.com.edgekey.net’ is not trusted.
ERROR: The certificate of ‘devimages.apple.com.edgekey.net’ hasn't got a known issuer.
e12714@e12714-mac00:~/Downloads/tmp/20140131_180312$ wget http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear4/fileSequence0.ts
--2014-01-31 16:01:46--  http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear4/fileSequence0.ts
Resolving devimages.apple.com.edgekey.net (devimages.apple.com.edgekey.net)... 23.73.64.225
Connecting to devimages.apple.com.edgekey.net (devimages.apple.com.edgekey.net)|23.73.64.225|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1878120 (1.8M) [video/mp2t]
Saving to: ‘fileSequence0.ts.1’

100%[==============================================================================>] 1,878,120   9.85MB/s   in 0.2s   

2014-01-31 16:01:47 (9.85 MB/s) - ‘fileSequence0.ts.1’ saved [1878120/1878120]

https下载失败的原因是什么?

2 个答案:

答案 0 :(得分:3)

使用wget --no-check-certificate参数。

答案 1 :(得分:0)

我认为因为https是ssl的协议,所以它应该在服务器上受支持,如果支持,你需要使用握手协议,警报协议,密码和记录协商参数。