I want to let users access their own Google Drive storage on my application. I have followed Google's instructions on their quick-start website, but I keep getting this error:
C:/RailsInstaller/Ruby2.2.0/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:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/timeout.rb:73:in `timeout'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:923:in `connect'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:852:in `start'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:1375:in `request'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:82:in `perform_request'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:40:in `block in call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:32:in `call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/request/url_encoded.rb:15:in `call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:139:in `build_response'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:377:in `run_request'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:177:in `post'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/signet-0.7.3/lib/signet/oauth_2/client.rb:960:in `fetch_access_token'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/signet-0.7.3/lib/signet/oauth_2/client.rb:998:in `fetch_access_token!'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/googleauth-0.5.1/lib/googleauth/signet.rb:69:in `fetch_access_token!'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/googleauth-0.5.1/lib/googleauth/user_authorizer.rb:179:in `get_credentials_from_code'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/googleauth-0.5.1/lib/googleauth/user_authorizer.rb:201:in `get_and_store_credentials_from_code'
from quickstart.rb:36:in `authorize'
from quickstart.rb:45:in `<main>'
I have tried downloading the certificate from http://curl.haxx.se/ca/cacert.pem
and adding it to my system environments as SSL_CERT_FILE
, but I still get the same error. Additionally, I get the same result when I update to RubyGem 2.6.7.
I also realized that the 'drive-ruby-quickstart.yaml' file created by 'quickstart.rb' is blank. Even when I did manage to properly store 'drive-ruby-quickstart.yaml' on Linux, Fedora 23, it led me to this:
/home/username/.gem/ruby/gems/google-api-client-0.9.19/lib/google/apis/core/http_command.rb:208:in `check_status': Unauthorized (Google::Apis::AuthorizationError)
I have been on this for weeks and still can't solve it. Please help.
I am mainly testing on Windows 10, and my RubyGem version is 2.6.7. I've tried Ruby versions 2.2.3 and 2.3.1, and Rails 5.0.0.1.