OpenSSL::SSL::SSLError Ubuntu 12.04 only

2019-04-01 10:52发布

I am using Evernote Ruby API to develop a web application(using rails and oauth). But while running the application in Ubuntu 12.04 I am getting an error "SSL_connect SYSCALL returned=5 errno=0 state=unknown state." This happens only in ubuntu 12.04. Ubuntu versions < 12.04 doesnt have this problem.

2条回答
我欲成王,谁敢阻挡
2楼-- · 2019-04-01 11:07

What is your current SSL_Cert_file environmental variable set to? Try setting the SSL_Cert_file environmental variable to:

export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

If that doesn't work and you are using RVM maybe setting the path to: ~/.rvm/usr/ssl/cert.pem

Before you make any changes just note down what the path currently is so that you can set it back if needed.

查看更多
混吃等死
3楼-- · 2019-04-01 11:20

This issue is being caused by a known bug in Ubuntu openssl 1.0.1:

https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/965371

https://serverfault.com/questions/389197/ssl-routinesssl23-writessl-handshake-failure

Unfortunately, there's a lot of fingerpointing going on and no fixes. If you're running Ruby 1.9 you can force the SSL version to either TLSv1 or SSLv3 to fix it (the problem is with TLSv1.1):

Ruby SSL error - sslv3 alert unexpected message

查看更多
登录 后发表回答