2017-02-09 38 views
0

在windows上工作正常的windows上面對這個錯誤嘗試了很多soltuions,但沒有任何工作對我來說,請不要將它標記爲dublicate。Ruby和SSL_connect SYSCALL返回= 5 errno = 0狀態= SSLv2/v3

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:73:in `timeout' 
    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:in `do_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:in `request' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.10.0/lib/faraday/adapter/net_http.rb:83:in `perform_request' 
    from C:/Ruby22x64/lib/ruby/gems/2.2.0/gems/faraday0.10.0/lib/faraday/adapter/net_http.rb:41:in `block in call' 
    from C:/Ruby_22x64/lib/ruby/gems/2.2.0/gems/faraday0.10.0/lib/faraday/adapter/net_http.rb:88:in `with_net_http_connection' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.10.0/lib/faraday/adapter/net_http.rb:33:in `call' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.10.0/lib/faraday/request/url_encoded.rb:15:in `call' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.10.0/lib/faraday/rack_builder.rb:139:in `build_response' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.10.0/lib/faraday/connection.rb:377:in `run_request' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.10.0/lib/faraday/connection.rb:177:in `post' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/signet-0.7.3/lib/signet/oauth_2/client.rb:960:in `fetch_access_token' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/signet-0.7.3/lib/signet/oauth_2/client.rb:998:in `fetch_access_token!' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/googleauth-0.5.1/lib/googleauth/signet.rb:69:in `fetch_access_token!' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/googleauth-0.5.1/lib/googleauth/signet.rb:45:in `apply!' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google-api-client-0.9.20/lib/google/apis/core/http_command.rb:300:in `apply_request_options' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google-api-client-0.9.20/lib/google/apis/core/http_command.rb:282:in `block in execute_once' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/hurley-0.2/lib/hurley/client.rb:46:in `get' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google-api-client-0.9.20/lib/google/apis/core/http_command.rb:272:in `execute_once' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google-api-client-0.9.20/lib/google/apis/core/http_command.rb:107:in `block (2 levels) in execute' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/retriable-2.0.2/lib/retriable.rb:53:in `block in retriable' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/retriable-2.0.2/lib/retriable.rb:48:in `each' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/retriable-2.0.2/lib/retriable.rb:48:in `with_index' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/retriable-2.0.2/lib/retriable.rb:48:in `retriable' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google-api-client-0.9.20/lib/google/apis/core/http_command.rb:104:in `block in execute' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/retriable-2.0.2/lib/retriable.rb:53:in `block in retriable' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/retriable-2.0.2/lib/retriable.rb:48:in `each' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/retriable-2.0.2/lib/retriable.rb:48:in `with_index' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/retriable-2.0.2/lib/retriable.rb:48:in `retriable' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google-api-client-0.9.20/lib/google/apis/core/http_command.rb:96:in `execute' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google-api-client-0.9.20/lib/google/apis/core/base_service.rb:351:in `execute_or_queue_command' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google-api-client-0.9.20/generated/google/apis/drive_v3/service.rb:772:in `get_file' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google_drive-2.1.2/lib/google_drive/session.rb:216:in `file_by_id' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google_drive-2.1.2/lib/google_drive/session.rb:228:in `file_by_url' 
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/google_drive-2.1.2/lib/google_drive/session.rb:275:in `spreadsheet_by_url'from final_gmail_script.rb:19:in `<main>' 

代碼示例

require 'capybara' 
require 'google_drive' 
require 'headless' 
require 'certified' 

credentials = Google::Auth::UserRefreshCredentials.new(
client_id: "15##########3-k###################################hu2e.apps.googleusercontent.com", 
client_secret: "r#####_TO-#######3_E-##-", 
scope: [ 
    "https://www.googleapis.com/auth/drive", 
    "https://spreadsheets.google.com/feeds/", 
], 
refresh_token: "1/BYLI########################################4") 
google_session = GoogleDrive::Session.from_credentials(credentials) 
google_spreadsheet = google_session.spreadsheet_by_url("#########") 

得到錯誤,而試圖獲取spreadsheet_by_url。

ruby​​的版本是 - 2.2.5

+0

http://stackoverflow.com/questions/25814210/opensslsslsslerror-ssl-connect-syscall-returned-5-errno-0-state-sslv3-read? – Sooraj

+0

使用TLS 1.0(或以上)和[服務器名稱指示(SNI)](http://en.wikipedia.org/wiki/Server_Name_Indication)。另請參閱[ruby「SSL_connect SYSCALL returned = 5 errno = 0 state = SSLv2/v3」](https://www.google.com/search?num=40&q=ruby+「SSL_connect + SYSCALL + returned%3D5 + errno%3D0 +狀態%3DSSLv2%2Fv3「&oq = ruby​​ +」SSL_connect + SYSCALL +返回%3D5「) – jww

回答

0

好像你沒有發送證書來訪問電子表格。您可能需要通過Google服務生成一個,導出它,將電子表格訪問權限授予您的Google服務電子郵件用戶,然後使用該證書發出請求。

https://console.developers.google.com/apis/dashboard更多信息

+0

嗨@xenover感謝您的回覆,但我使用的是由google提供的config.json文件,用於訪問電子表格和腳本工作正常在Ubuntu上,但它是在Windows上拋出特定的錯誤 –

相關問題