arsduo/koala — Issue #146: Another OpenSSL::SSL::SSLError problem, previous solutions not working
Author: subtractiv
Created: 2011-11-20 21:53:47+00:00
State: open

Hi,

Count me in with one of the many people having problems with SSL verification. That's fine, but none of the other solutions help. For good measure, the complete error message:

OpenSSL::SSL::SSLError
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B

Everything works until I try interacting with Koala's API object. I can get the access token and set 'public_stream' permissions just fine. When looking at the test account's application permissions, mine is in there, as expected. The line in question:

@person.facebook.get_connections 'me', 'permissions'

The `@person.facebook` is just for convenience:

def facebook
Koala::Facebook::API.new facebook_access_code
end

### What I've tried so far:

All of these are using the ca_cert file from curl.haxx.se, if it matters.

**https://github.com/technoweenie/faraday/wiki/Setting-up-SSL-certificates**

Koala.http_service.http_options = {
ssl: {
# ca_file: '/opt/local/etc/openssl/cacert.crt', # Crashes rails/server
ca_path: '/opt/local/etc/openssl/', # Doesn't do anything, I guess
verify: true
}
}

No luck. Telling it where `ca_file` is just crashes rails/server in 1,317 lines of loaded features output (Faraday is the last one, if it helps). Adding `ca_path` doesn't crash anything, but it doesn't fix anything, either.

**https://github.com/arsduo/koala/issues/69**

Koala.http_service.ca_file = "/path/to/ca/file"
Koala.http_service.ca_path = "/path/to/cas"

Nothing here, either.

**https://github.com/arsduo/koala/issues/110**

Koala.http_service.ca_file = '/opt/local/share/curl/curl-ca-bundle.crt'

Unsurprisingly, nothing. Like before, this crashes rails/server.

**Forgot where I found this one**

Koala.http_service.http_options = {
ssl: {
verify: false
}
}

Progress? Maybe. I end up with this, which may or may not be a separate problem that I'll have to deal with later.

Koala::Facebook::APIError in People#show
OAuthException: Error validating application.

**One more, forgot where I found it**

@person.facebook.get_connections 'me', 'permissions', { :use_ssl => false }

Still throws the same `OpenSSL::SSL::SSLError` exception. Ugh.

So there we go. I'm pretty sure that's everything that I've tried. If you need any more information, let me know. I'm using `Rails 3.1.2`, `Koala 1.2.1`, `Ruby 1.9.3` on OS X Lion. Thanks in advance for any help with this.