Skip to content
This repository has been archived by the owner on Feb 5, 2018. It is now read-only.

First-time user: Error connecting/authenticating to GitHub - no commands work #114

Open
caratang opened this issue Apr 8, 2015 · 4 comments

Comments

@caratang
Copy link

caratang commented Apr 8, 2015

Hello, I'm trying to use teachers_pet (0.3.5) and can't seem to get it working. I've never used it before so hopefully it's something simple to fix. I'm trying to set up teams using create_student_teams and it's giving me the error below. I've tried entering my password and using a token (both on command line and in the environment variable) and get the same result. Any idea how to make it work? (I am able to connect to GitHub otherwise, e.g., with git push)

$ teachers_pet create_student_teams --students=./students.txt --organization=PCC-CIS-233J --username=caratang

Authenticating to GitHub...
c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (Faraday::SSLError)

from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in block in connect' from c:/Ruby22-x64/lib/ruby/2.2.0/timeout.rb:74:intimeout'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in connect' from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:863:indo_start'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:852:in start' from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:1375:inrequest'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:1133:in get' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:80:inperform_request'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:40:in block in call' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:87:inwith_net_http_connection'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:32:in call' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:incall'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:in call' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:inbuild_response'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in run_request' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:140:inget'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sawyer-0.5.5/lib/sawyer/agent.rb:94:in call' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/octokit-3.3.1/lib/octokit/client.rb:339:inrequest'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/octokit-3.3.1/lib/octokit/client.rb:200:in paginate' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/octokit-3.3.1/lib/octokit/client/organizations.rb:206:inorganization_teams'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/lib/teachers_pet/client_decorator.rb:30:in existing_teams_by_name' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/lib/teachers_pet/actions/create_student_teams.rb:6:increate_student_teams'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/lib/teachers_pet/actions/create_student_teams.rb:32:in run' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/lib/teachers_pet/commands/create_student_teams.rb:10:increate_student_teams'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:instart'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/bin/teachers_pet:4:in <top (required)>' from c:/Ruby22-x64/bin/teachers_pet:23:inload'
from c:/Ruby22-x64/bin/teachers_pet:23:in `

'

@PeterDaveHello
Copy link

Did you try to update your ruby on windows to latest?
This may help you I think:
Workaround RubyGems' SSL errors on Ruby for Windows (RubyInstaller)

@caratang
Copy link
Author

Thank you for responding. That looks like the same error I'm getting, but I already have the new certificate mentioned as the fix in the workaround. I just installed Ruby a week or so ago in order to use teachers_pet.

Any other ideas appreciated.

@micskeiz
Copy link

I ran into the same problem, the following helped me.

The problem is that Ruby does not use the certificate store of the OS, and does not recognize the certificate authority (CA) who signed the SSL certificate of the api.github.com site (see explanation here: Why is Ruby unable to verify an SSL certificate?).

As of now (2015-08), api.github.com is signed by Digicert. Thus you have to specify that this is a trusted CA. This can be done in the SSL_CERT_FILE environment variable. All you need is the certificate of the CA in pem format. Luckily, version 2.1 of the Ruby install on Windows already contains this certificate. Thus in a command prompt execute:

set SSL_CERT_FILE=C:\Ruby21\lib\ruby\2.1.0\rubygems\ssl_certs\DigiCertHighAssuranceEVRootCA.pem

Now you can use teachers_pet in the same command prompt (the above does not persist the environment variable, it is only valid for this session).

@stephenlevitt
Copy link

@micskeiz Thanks for your advice! It helped me get teachers_pet running on Windows.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants