softlayer / softlayer-ruby

http://softlayer.github.io/softlayer-ruby/
MIT License
54 stars 35 forks source link

SSL error on Ruby client #32

Closed paulmcgrail closed 10 years ago

paulmcgrail commented 10 years ago

Hi, When attempting to execute any of your example scripts with my SL cred I get the below SSL error, the creds are validated. I'm using Ruby 2.0 and the latest softlayer-ruby files. Any help or advice you can provide is appreciated as I would like to get up and running with the Ruby client, but I'm stuck at the starters block.

Thanks, Paul

Unable to retrieve account information: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:918:in connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (Ope nSSL::SSL::SSLError) from C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:918:inblock in connect' from C:/Ruby200-x64/lib/ruby/2.0.0/timeout.rb:66:in timeout' from C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:918:inconnect' from C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:862:in do_start' from C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:857:instart' from C:/Ruby200-x64/lib/ruby/2.0.0/xmlrpc/client.rb:472:in do_rpc' from C:/Ruby200-x64/lib/ruby/2.0.0/xmlrpc/client.rb:279:incall2' from C:/Ruby200-x64/lib/ruby/2.0.0/xmlrpc/client.rb:260:in call' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/softlayer_api-2.1.0/lib/softlayer/Service.rb:278:incall_softlayer_api_with_params' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/softlayer_api-2.1.0/lib/softlayer/Service.rb:207:in method_missing' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/softlayer_api-2.1.0/lib/softlayer/Account.rb:129:inaccount_for_client' from pm-test-servers.rb:36:in `

'

SLsthompson commented 10 years ago

Please review the following Stack Overflow question regarding this situation and see if it applies to your situation:

http://stackoverflow.com/questions/19463827/ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificat

cbreden commented 10 years ago

You can also install a certificate file manually and set up an environment variable:

  1. Download http://curl.haxx.se/ca/cacert.pem into C:/Ruby200-x64/cacert.pem
  2. Go to your Computer -> Advanced Settings -> Environment Variables
  3. Create a new System Variable:

    Variable: SSL_CERT_FILE Value: C:/Ruby200-x64/cacert.pem

You'll need to restart your applications/command-prompts, but Ruby should be able to verify after that.

paulmcgrail commented 10 years ago

@cbreden - Hi, this provided me with a work around. Thank You!

SLsthompson commented 10 years ago

Thank you for your support of this effort. Please don't hesitate to come back if you have further trouble, or if you don't see what you need. Documentation is not 100% yet so questions are most welcome.