heroku/databasedotcom — Issue #48: certificate verify failed when trying to connect
Author: rb2k
Created: 2012-01-11 13:17:16+00:00
State: open

I seem to have problems even creating a basic connection.
I create a new "Force.com Developer Edition" account to test this.

This is the basic code I'd love to be able to run:

````ruby
require 'databasedotcom'
puts "Salesforce!"

app_client_id = 'myextremelylongclientidstring'
app_client_secret = '1234567890'

puts "setting up the client"
client_options = {}
client_options[:client_id] = app_client_id
client_options[:client_secret] = app_client_secret
#client_options[:verify_mode] = 'VERIFY_NONE'

client = Databasedotcom::Client.new client_options
puts "getting a token"
token = client.authenticate :username => "my.account@mydomain.com",
:password => "mypassword_concatinated_with_my_security_token"
puts "Got a token: #{token}"

available_things = client.list_sobjects
puts "Got these things: #{available_things}"
````

this is the result without the verify_mode passed in:

Salesforce!
setting up the client
getting a token
.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
from /Users/mseeger/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
from /Users/mseeger/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from /Users/mseeger/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from /Users/mseeger/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect'
from /Users/mseeger/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from /Users/mseeger/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:744:in `start'
from /Users/mseeger/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1284:in `request'
from /Users/mseeger/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1307:in `send_entity'
from /Users/mseeger/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1096:in `post'
from /Users/mseeger/.rvm/gems/ruby-1.9.3-p0/gems/databasedotcom-1.2.7/lib/databasedotcom/client.rb:110:in `authenticate'

This happens WITH the VERIFY_NONE set:

$ ruby salesforce.rb
Salesforce!
setting up the client
getting a token
/Users/mseeger/.rvm/gems/ruby-1.9.3-p0/gems/databasedotcom-1.2.7/lib/databasedotcom/client.rb:112:in `authenticate': client identifier invalid (Databasedotcom::SalesForceError)
from salesforce.rb:15:in `

'

Any idea what could cause this?