简体   繁体   中英

Ruby SSL Error working with Evernote API (Mac, El Capitan)

Trying to get the basic ruby Evernote client app working.

I got my developer token and followed the readme in the sample app.

  1. Open sample/client/EDAMTest.rb
  2. Scroll down and fill in your Evernote developer token.
  3. On the command line, run the following command to execute the script:

    ruby EDAMTest.rb

Simple. But I'm getting this SSL Error.

/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)

Tried a few things with brew and 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.

Full trace.

/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>'

I ended up patching it by turning off verification.

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

Still open to any better ideas.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM