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 #98

Closed
sharpsaw opened this issue May 8, 2012 · 23 comments
Closed

SSL #98

sharpsaw opened this issue May 8, 2012 · 23 comments

Comments

@sharpsaw
Copy link

sharpsaw commented May 8, 2012

I currently am getting this, new as of sometime this morning maybe.

% echo yep | gist -
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: 
certificate verify failed
Usage: gist [options] [filename or stdin] [filename] ...
...etc

When I comment out lib/gist.rb line 388

# http.ca_file = ca_cert

...it works.

I'm not so great with SSL stuff, so I don't if this is on my end or what. I
don't see anyone else complaining about it, so it makes me suspect my end...
but if I could get some pointers on how to fix it.

Thanks!

-rking

@pfactum
Copy link

pfactum commented May 8, 2012

++ to this question.

@icio
Copy link

icio commented May 8, 2012

+1 I'm experiencing this too

@solsticedhiver
Copy link

same problem here

@ronin13
Copy link

ronin13 commented May 9, 2012

The workaround fixes it, thanks; but commenting out ca_cert is not a long term solution.

@sharpsaw
Copy link
Author

sharpsaw commented May 9, 2012

Interesting.

If you do something like:

cd $GISTGEMDIR/
mv lib/gist/cacert.pem oldcert.pem
curl http://curl.haxx.se/ca/cacert.pem > lib/gist/cacert.pem

(Then re-enable the disabled http.ca_file = ca_cert line from my first post,
if you did that.)

...it works.

I still don't fully understand what all is going on, though.
-rking

@solsticedhiver
Copy link

the cacert file is used to verify the peer on SSL connect, I think (not sure)
So without, it still uses a SSL connexion. It just that we don't verify that we talk to the real api.github.com

No ?

@sharpsaw
Copy link
Author

sharpsaw commented May 9, 2012

solstice -

That sounds about right to me.

The cacert.pem from curl.haxx.se should fix the issue, no?

P.S.: I got that URL from Googling github cacert.pem and visiting: https://gist.github.com/867550

-rking

@solsticedhiver
Copy link

it's not working here with the cacert.pem from curl.haxx.se ?!

@ronin13
Copy link

ronin13 commented May 9, 2012

The one from curl.haxx.se is a generic one,

to obtain the github one do

openssl s_client -showcerts -connect api.github.com:443

which prints the entire certificate chain to stdout,

however, this will still fail because verification fails

openssl s_client -showcerts -connect api.github.com:443 -issuer_checks (you can also run other checks)

@sharpsaw
Copy link
Author

sharpsaw commented May 9, 2012

By the way - if you go to https://gist.github.com and look at the details of the cert, it has a Validity > "Not Before" of 4/29/2012. So my guess is they got a new cert and pushed it out a couple of days ago when we started seeing the errors.

ronin - I couldn't /quite/ git this same information from the openssl CLI. That first line sits there waiting for an HTTP request, in fact. Is there a handy way to say, "Get me this host:port's .pem file" ?

Thanks! (Learning stuff / having fun).
-rking

@ghost
Copy link

ghost commented May 12, 2012

Actually, following the curl command above to get the pem, when I try to run gist I get this now:

∴ gist app/models/user.rb
Creating gist failed: 422 Unprocessable Entity

The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.

@stanigator
Copy link

I'm experiencing this as well.

@johnmaguire
Copy link

Add me to the list of people experiencing this issue, Debian wheezy, gist 3.1.0, ruby 1.9.3p194.

I also tried the curl.haxx.se certificate, and began getting the 422 Unprocessable Entity error as well.

This is one of my favorite scripts. :(

@ghost
Copy link

ghost commented May 24, 2012

Starting to think we, the community, might have to adopt this script and fix it ourselves. No response for quite some time from defunkt, though that's easily attributable to working his ass off :-)

@stanigator
Copy link

@deryldoucette How do you propose us to do that? I'm not sure how I can do that as a Ruby newbie...

@ghost
Copy link

ghost commented Jun 21, 2012

I'm not the greatest either. Maybe we turn it into something like a code walkthrough and we all learn how its done. We would need to read the 3rd version of Github's API and read the Gist related portions and this gem's code. walk through and learn. Only thing I can suggest.

@isomorphisms
Copy link

@sharpsaw s/line 338/line 138/

@ConradIrwin
Copy link
Collaborator

I've uploaded the jist gem https://github.com/ConradIrwin/jist; that works as a replacement for gist until defunkt has time. Please let me know if it works for you!

@tekknolagi
Copy link

@ConradIrwin, fabulous job! Love jist

@rking
Copy link
Contributor

rking commented Aug 3, 2012

Seriously.

Want gist support? ⇒ Fork it and do your own patches, I guess.

Want jist support? ⇒ cirwin's on it.

@ghost
Copy link

ghost commented Aug 4, 2012

@rking err? I think we already covered that

@indirect
Copy link
Collaborator

indirect commented Nov 4, 2012

I'm on it... should have this fixed shortly.

@indirect
Copy link
Collaborator

indirect commented Nov 4, 2012

Fixed by 3aacc1f. I'll have a release out as soon as I see if there are any other blockers.

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