Last Updated: August 25, 2022
·
82.11K
· joshteng

Fix SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

Set to verify none (run that bit of code before making the request or put this bit in an initializer)

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

UPDATE: Solution above works ok if you're just coding on development machine.. But for a far better solution (especially production servers), please follow this link: http://mislav.uniqpath.com/2013/07/ruby-openssl/

6 Responses
Add your response

Where shall I add this code to?!

over 1 year ago ·
over 1 year ago ·

Thank you!

over 1 year ago ·

Thank you very much.
I was facing this problem since 1 month.Thanks a lot

over 1 year ago ·

Add this line in the code

options = {
:username =>jiraUsrname,
:password =>jiraPwd,
:site => jiraUrlnew,
:contextpath => '',
:auth
type => :basic,
:usessl => true,
:ssl
verifymode => OpenSSL::SSL::VERIFYNONE
}
:sslverifymode => OpenSSL::SSL::VERIFY_NONE this line of code fix this issue

over 1 year ago ·

This is a terrible idea and you should never do this.

over 1 year ago ·