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 a6fe67e1792022a7583ce6aa80ae6d09c3bb0ab3..8190a65b96fb63b4c30773a0f5b5b8aa85e86ce1 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 = []