pascal jungblut posts

Devise SSL error on FreeBSD

Using Devise to authenticate users with OAuth and Facebook I was having a problem with SSL. I got a verification error:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

There’s lots of advice on how to fix the certificate verification error on Windows and Linux systems. However, providing a :ca_path doesn’t work on FreeBSD as the certificates are located in one file. You need to specify :ca_file in your config/initializers/devise.rb instead:

config.omniauth :facebook,
	FB_KEY, FB_SECRET,
	client_options: {
	ssl: { ca_file: '/usr/local/share/certs/ca-root-nss.crt' }
	}