2016-02-28 59 views
0

試圖讓the basic ruby Evernote client app正常工作。使用Evernote API(Mac,El Capitan)的Ruby SSL錯誤

我得到了my developer token並遵循示例應用程序中的自述文件。

  1. 打開樣品/客戶/ EDAMTest.rb
  2. 向下滾動並填寫您的Evernote開發人員令牌。
  3. 在命令行中運行以下命令來執行腳本:

    ruby EDAMTest.rb

簡單。但是我得到這個SSL錯誤。

/Users/james/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:923:in`connect':SSL_connect returned = 1 errno = 0 state = SSLv3讀取服務器證書B:證書驗證失敗(OpenSSL :: SSL :: SSLError)

用brew和rvm嘗試了幾件事情。

$ rvm osx-ssl-certs status all     
> Certificates for /usr/local/etc/openssl/cert.pem: Up to date. 
> Certificates for /etc/openssl/cert.pem: Up to date. 

完整跟蹤。

/Users/james/.rvm/rubies/ruby-2.2.3/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 (OpenSSL::SSL::SSLError) 
    from /Users/james/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:923:in `block in connect' 
    from /Users/james/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/timeout.rb:73:in `timeout' 
    from /Users/james/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:923:in `connect' 
    from /Users/james/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:863:in `do_start' 
    from /Users/james/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:852:in `start' 
    from /Users/james/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1375:in `request' 
    from /Users/james/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1398:in `send_entity' 
    from /Users/james/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1186:in `post' 
    from /Users/james/.rvm/gems/ruby-2.2.3/gems/evernote-thrift-1.25.1/lib/thrift/transport/http_client_transport.rb:58:in `flush' 
    from /Users/james/.rvm/gems/ruby-2.2.3/gems/evernote-thrift-1.25.1/lib/thrift/client.rb:41:in `send_message' 
    from /Users/james/.rvm/gems/ruby-2.2.3/gems/evernote-thrift-1.25.1/lib/Evernote/EDAM/user_store.rb:23:in `send_checkVersion' 
    from /Users/james/.rvm/gems/ruby-2.2.3/gems/evernote-thrift-1.25.1/lib/Evernote/EDAM/user_store.rb:18:in `checkVersion' 
    from sample/client/EDAMTest.rb:39:in `<main>' 

回答

0

我最終通過關閉驗證來修補它。

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE 

仍然是開放的更好的想法。