curb icon indicating copy to clipboard operation
curb copied to clipboard

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

Open poc7667 opened this issue 11 years ago • 3 comments

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>'

poc7667 avatar Jul 24 '14 07:07 poc7667

I think you may want to try ssl_verify_host=0

taf2 avatar Jul 28 '14 18:07 taf2

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

poc7667 avatar Jul 29 '14 15:07 poc7667

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

marcpmichel avatar Aug 29 '14 15:08 marcpmichel