0

I am having issues running a app locally with gcloud on a windows 10 machine. I get the following error:

C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:in `connect_nonblock': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (Faraday::SSLError)
    from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:in `connect'
    from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
    from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:852:in `start'
    from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:1398:in `request'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:82:in `perform_request'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:40:in `block in call'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:32:in `call'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/request/url_encoded.rb:15:in `call'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:139:in `build_response'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:377:in `run_request'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:177:in `post'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/signet-0.7.2/lib/signet/oauth_2/client.rb:960:in `fetch_access_token'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/signet-0.7.2/lib/signet/oauth_2/client.rb:998:in `fetch_access_token!'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/googleauth-0.5.1/lib/googleauth/signet.rb:69:in `fetch_access_token!'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/gcloud-0.7.2/lib/gcloud/credentials.rb:58:in `initialize'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/gcloud-0.7.2/lib/gcloud/credentials.rb:84:in `new'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/gcloud-0.7.2/lib/gcloud/credentials.rb:84:in `default'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/gcloud-0.7.2/lib/gcloud/datastore.rb:62:in `datastore'
    from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/gcloud-0.7.2/lib/gcloud.rb:106:in `datastore'
    from app.rb:21:in `<main>'

I have searched for the answer to this question. Here is a good example of an answer to this question: https://github.com/lostisland/faraday/issues/392

The answer boils down to I need to have a pem file and tell Ruby where it is with the environment variable SSL_CERT_FILE.

In my case it is not working.

How would I fix this???

Zachary Newman
  • 20,014
  • 4
  • 39
  • 37
Eric Snyder
  • 1,816
  • 3
  • 22
  • 46
  • It may just be a certificate issue, you can try clearing your locally cached certificates first just to get that out of the way. From a command prompt run: `certutil -urlcache crl delete` – gmiley Jun 02 '16 at 01:54
  • That was a good idea...unfortunately it didn't work. – Eric Snyder Jun 02 '16 at 02:06
  • Ya, just something to try to at least rule bunked certs out of the picture right up front, and doesn't have any appreciable time cost. =) Too bad that didn't fix the issue though... – gmiley Jun 02 '16 at 02:13
  • What pem are you using? Have you tried [downloading the pem](http://curl.haxx.se/ca/cacert.pem) used by curl? See [GoogleCloudPlatform/gcloud-ruby#218](https://github.com/GoogleCloudPlatform/gcloud-ruby/issues/218). – blowmage Jun 02 '16 at 19:40
  • Blomage: Yes, I have tried the source you spec for the pem file. I have also tried the fix that you reference. That is what I am trying to say above. Neither solution is working, that's why I am here asking this question. – Eric Snyder Jun 03 '16 at 01:02
  • I have also tried gem 'certified' in my Gemfile. No joy. – Eric Snyder Jun 03 '16 at 01:25
  • Looks to me like ruby is finding and using a bad cert, probably not the one you are specifying. I suspect an environment issue. Can you try on another computer? In a virtual machine? – blowmage Jun 03 '16 at 13:44

0 Answers0