Configure CA path for OpenID
authorTom Hughes <tom@compton.nu>
Tue, 31 Mar 2015 13:03:10 +0000 (14:03 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 31 Mar 2015 13:03:10 +0000 (14:03 +0100)
config/initializers/omniauth.rb

index a6fe67e..8190a65 100644 (file)
@@ -1,3 +1,9 @@
+require "openid/fetchers"
+
+CA_BUNDLES = ["/etc/ssl/certs/ca-certificates.crt", "/etc/pki/tls/cert.pem"]
+
+OpenID.fetcher.ca_file = CA_BUNDLES.find { |f| File.exist?(f) }
+
 OmniAuth.config.logger = Rails.logger
 OmniAuth.config.failure_raise_out_environments = []