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

Using insecure option but still getting SSL verification error #73

Closed
prekageo opened this issue Mar 5, 2014 · 3 comments
Closed

Using insecure option but still getting SSL verification error #73

prekageo opened this issue Mar 5, 2014 · 3 comments

Comments

@prekageo
Copy link

prekageo commented Mar 5, 2014

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
Copy link
Owner

toland commented Mar 19, 2014

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

@jacobsimeon
Copy link

Related #74

@julik
Copy link
Collaborator

julik commented Apr 8, 2016

This change is already applied from what I can see.

@julik julik closed this as completed Apr 8, 2016
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

4 participants