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 error "certificate verify failed" #23

Closed
quigybo opened this issue Nov 9, 2010 · 17 comments
Closed

SSL error "certificate verify failed" #23

quigybo opened this issue Nov 9, 2010 · 17 comments

Comments

@quigybo
Copy link

quigybo commented Nov 9, 2010

I am getting the following error
$ echo test | gist
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

Changing the following suppressed the error, although I doubt it is a proper fix.
diff --git a/lib/gist.rb b/lib/gist.rb
index 6ecc10a..be5b119 100644
--- a/lib/gist.rb
+++ b/lib/gist.rb
@@ -119,7 +119,7 @@ module Gist
end

     http.use_ssl = true
-    http.verify_mode = OpenSSL::SSL::VERIFY_PEER
+    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
     http.ca_file = File.join(File.dirname(__FILE__), "cacert.pem")

     req = Net::HTTP::Post.new(url.path)

Also note the following, even though I am currently using commit 1c27da3 (v2.0.0).
$ gist --version
1.4.0
I think somebody forgot to build gist in commit 83bf891. This shouldn't affect the current issue however, as it was just a version bump from v1.4.0.

Possible relevant info:
$ ruby --version
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

@DeMarko
Copy link

DeMarko commented Nov 11, 2010

I'm getting the same thing.

@stevewoodcock
Copy link

Me too!

@aaronky
Copy link

aaronky commented Nov 12, 2010

So am I
gist --version
2.0.0

&

ruby --version
ruby 1.8.7 (2009-12-24 patchlevel 248) [amd64-freebsd7]

@juev
Copy link

juev commented Nov 13, 2010

I have the same problem.

$ gist -v
2.0.0

$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]

@bitprophet
Copy link

Same here. Gist 2.0.0. I assume this is related to the recent Github switchover to HTTPS-only?

Under

ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]

I get:

certificate verify failed

And under

ruby 1.8.7 (2010-05-25 patchlevel 266) [i686-darwin9.8.0]

I get:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

@githubster
Copy link

Same. Thanks
ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]

@tbbooher
Copy link

yeah -- ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]

same error

@ghost
Copy link

ghost commented Dec 14, 2010

Same here...

$ gist --version
2.0.0
$ ruby --version
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10]
$ echo 'test' | gist
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Usage: gist [options] [filename or stdin] [filename] ...
... <snip> ...

@ermaker
Copy link
Contributor

ermaker commented Dec 19, 2010

Same.

$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
$ gist -v
2.0.0
$ echo 'test' | gist
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

@dapi
Copy link

dapi commented Dec 19, 2010

same error:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
gist 2.0.0
OS: Ubuntu 10.10

@darthdeus
Copy link

Same here

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
$ gist -v
2.0.0
$ echo 'foo' | gist
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

@yhager
Copy link

yhager commented Dec 27, 2010

metoo

@rduplain
Copy link

rduplain commented Jan 1, 2011

The gem includes CA certificates, but the standalone script is not using them. Offering a fix in rduplain/gist@1e29722b84635b8fa680dca4fd7e32a976402138. Test using:

https://github.com/rduplain/gist/raw/master/gist

e.g.

curl -O https://github.com/rduplain/gist/raw/master/gist
chmod 755 gist
./gist ...

@darthdeus
Copy link

Doesn't work with 1.9.2

$ echo test | ./gist -
invalid byte sequence in US-ASCII

Adding

#encoding: utf-8 

on the second line fixes that https://gist.github.com/762011

@rduplain
Copy link

rduplain commented Jan 1, 2011

Added suggestion from darthdeus in rduplain@6553d8e3cdffce6fcc1fdf3865d39c37d8323aea

https://github.com/rduplain/gist/raw/master/gist

@philpennock
Copy link

Confirmed that rduplain's fix WorksForMe (and makes sense to read, from the PoV of someone familiar with SSL and passingly acquainted with Ruby).

@ghost
Copy link

ghost commented Jan 17, 2011

Yes, thanks rduplain! Your fix works well.

ConradIrwin added a commit to ConradIrwin/gist that referenced this issue May 3, 2013
This issue was closed.
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

Successfully merging a pull request may close this issue.