无法连接到api-ssl.bitly.com:443

时间:2015-04-15 19:45:06

标签: perl ssl lwp-useragent

因为两天我无法生成有点网址。这是我遇到的错误:

$VAR1 = bless( {
             '_content' => 'Can\'t connect to api-ssl.bitly.com:443
LWP::Protocol::https::Socket: SSL connect attempt failed with unknown error error:0D0C50A1:asn1 encoding routines:ASN1_item_verify:unknown message digest algorithm at /usr/local/share/perl/5.10.1/LWP/Protocol/http.pm line 51.
', '_rc' => 500,
             '_headers' => bless( {
                                    'client-warning' => 'Internal response',
                                    'client-date' => 'Wed, 15 Apr 2015 18:08:08 GMT',
                                    'content-type' => 'text/plain'
                                  }, 'HTTP::Headers' ),
             '_msg' => 'Can\'t connect to api-ssl.bitly.com:443',
             '_request' => bless( {
                                    '_content' => '',
                                    '_uri' => bless( do{\(my $o = 'https://api-ssl.bitly.com/v3/shorten?login=LOGIN&apiKey=API_KEY&longurl=LONG_URL')}, 'URI::https' ),
                                    '_headers' => bless( {
                                                           'user-agent' => 'libwww-perl/6.04'
                                                         }, 'HTTP::Headers' ),
                                    '_method' => 'GET'
                                  }, 'HTTP::Request' )
           }, 'HTTP::Response' );    

有任何见解。

更新

cat /etc/issue.net     

Ubuntu 10.04.4 LTS    
openssl version -a     
OpenSSL 0.9.8k 25 Mar 2009    
built on: Mon Aug 18 16:08:20 UTC 2014     
platform: debian-amd64     
options:  bn(64,64) md2(int) rc4(ptr,char) des(idx,cisc,16,int) blowfish(ptr2)        
compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM      

apt-cache policy openssl      
openssl:    
  Installed: 0.9.8k-7ubuntu8.21     
  Candidate: 0.9.8k-7ubuntu8.27   
  Version table:     
     0.9.8k-7ubuntu8.27 0     
        500 http://archive.ubuntu.com/ubuntu/ lucid-updates/main Packages    
        500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages    
 *** 0.9.8k-7ubuntu8.21 0     
        100 /var/lib/dpkg/status     
     0.9.8k-7ubuntu8 0      
        500 http://archive.ubuntu.com/ubuntu/ lucid/main Packages     

这就是我所拥有的,如果您需要更多,请告诉我。

$ perl -MIO::Socket::SSL -e 'print $IO::Socket::SSL::VERSION'   
1.74    
$ perl -MIO::Socket::SSL -e 'print $Net::SSLeay::VERSION'    
1.48    
$ perl -MIO::Socket::SSL -e 'print $LWP::Protocol::https::VERSION'  
$ perl -MLWP -le "print(LWP->VERSION)"    
 6.04     
$ perl -MIO::Socket::SSL -e 'print Net::SSLeay::OPENSSL_VERSION_NUMBER()'   
9470143   

更新
这可能是一个时间问题吗?

1 个答案:

答案 0 :(得分:1)

基于this link我假设你的OpenSSL太旧了,它不了解证书的SHA256算法。您需要将OpenSSL升级到至少0.9.8o。