Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL peer certificate or SSH remote key was not OK (Curl::Err::SSLPeerCertificateError) #212

Open
poc7667 opened this issue Jul 24, 2014 · 3 comments

Comments

@poc7667
Copy link

poc7667 commented Jul 24, 2014

I got the error on ubuntu but works on mac

But if I run the curl command on ubuntu , it works. is curb a buggy gem?

2.1.0/gems/curb-0.8.6/lib/curl/easy.rb:72:in `perform': SSL peer certificate or SSH remote key was not OK (Curl::Err::SSLPeerCertificateError)

RUBY

resp = Curl::Easy.http_post(server_url, content_to_send) do |curl|
  curl.ssl_verify_peer = false
  curl.headers = header.clone
end

Detail

/home/poc/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/curb-0.8.6/lib/curl/easy.rb:72:in `perform': SSL peer certificate or SSH remote key was not OK (Curl::Err::SSLPeerCertificateError)
    from /home/poc/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/curb-0.8.6/lib/curl/easy.rb:398:in `http_post'
    from /home/poc/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/curb-0.8.6/lib/curl/easy.rb:398:in `http_post'
    from curb.rb:12:in `curl_query'
    from curb.rb:21:in `<main>'
@taf2
Copy link
Owner

taf2 commented Jul 28, 2014

I think you may want to try ssl_verify_host=0

@poc7667
Copy link
Author

poc7667 commented Jul 29, 2014

But I use the same code to request for the same server, it works on Mac, but only failed on Ubuntu.

@marcpmichel
Copy link

I can confirm that adding 'ssl_verify_host = 0' on a debian does solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants