Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Using insecure option but still getting SSL verification error #73

Open
prekageo opened this Issue · 2 comments

3 participants

@prekageo

While I am using insecure = true, I still get SSL verification errors. Check below:

~ $ moob -t type -v -u user -p pass -m server.example.com
Trying to authenticate to server.example.com...
Failure: Patron::Error (SSL: certificate subject name 'default certificate' does not match target host name 'server.example.com')

Backtrace to provide in any support request:
/usr/lib/ruby/gems/1.9.1/gems/patron-0.4.18/lib/patron/session.rb:223:in `handle_request'
/usr/lib/ruby/gems/1.9.1/gems/patron-0.4.18/lib/patron/session.rb:223:in `request'
/usr/lib/ruby/gems/1.9.1/gems/patron-0.4.18/lib/patron/session.rb:126:in `get'
/usr/lib/ruby/gems/1.9.1/gems/moob-0.3.12/lib/moob/idrac6.rb:34:in `authenticate'
/usr/lib/ruby/gems/1.9.1/gems/moob-0.3.12/bin/moob:99:in `block in <top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/moob-0.3.12/bin/moob:95:in `each'
/usr/lib/ruby/gems/1.9.1/gems/moob-0.3.12/bin/moob:95:in `<top (required)>'
/usr/bin/moob:23:in `load'
/usr/bin/moob:23:in `<main>'

I fixed it by applying this diff:

diff --git a/ext/patron/session_ext.c b/ext/patron/session_ext.c
index bf98fa6..78255b4 100644
--- a/ext/patron/session_ext.c
+++ b/ext/patron/session_ext.c
@@ -493,7 +493,7 @@ static void set_options_from_request(VALUE self, VALUE request) {
   insecure = rb_iv_get(request, "@insecure");
   if(!NIL_P(insecure)) {
     curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
-    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1);
+    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
   }

   cacert = rb_iv_get(request, "@cacert");
@toland
Owner

@prekageo Thanks for the report. I will take a look at this and patch Patron as soon as I get a chance.

@jacobsimeon

Related #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.