From f1aeecc00b01276a444ef91a619e8b16f2f865fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Wed, 21 Nov 2012 17:28:39 +0100 Subject: [PATCH] force typhoeus (and thus curl) to use diaspora.yml's CA bundle --- Changelog.md | 6 ++++++ Gemfile.lock | 1 + config/defaults.yml | 1 + config/diaspora.yml.example | 5 +++++ lib/hydra_wrapper.rb | 2 ++ 5 files changed, 15 insertions(+) diff --git a/Changelog.md b/Changelog.md index 640dccbd2..151fb90bf 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,9 @@ +# 0.0.3.0 + +## Bug Fixes + +* Force Typhoeus/cURL to use the CA bundle we query via the config. Also add a setting for extra verbose output. + # 0.0.2.0 ## Refactor diff --git a/Gemfile.lock b/Gemfile.lock index 458e18d72..0280955b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -469,6 +469,7 @@ DEPENDENCIES rack-cors (= 0.2.7) rack-google-analytics (= 0.11.0) rack-piwik (= 0.1.3) + rack-protection (= 1.2) rack-rewrite (= 1.3.1) rack-ssl (= 1.3.2) rails (= 3.2.8) diff --git a/config/defaults.yml b/config/defaults.yml index 868354ef2..611f328cc 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -51,6 +51,7 @@ defaults: community_spotlight: enable: false suggest_email: + typhoeus_verbose: false services: facebook: enable: false diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index 1932a7a6e..c81a60e30 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -189,6 +189,11 @@ configuration: ## Section ## E-Mail address users can make suggestions about who should be ## in the spotlight to. #suggest_email: 'admin@example.org' + + ## CURL debug + ## Turn on extra verbose output when sending stuff. No you + ## don't need to touch this unless explicitly told to. + #typhoeus_verbose: true ## Setup E-Mail mail: ## Section diff --git a/lib/hydra_wrapper.rb b/lib/hydra_wrapper.rb index 036f3158d..627ac3ba7 100644 --- a/lib/hydra_wrapper.rb +++ b/lib/hydra_wrapper.rb @@ -8,6 +8,8 @@ require 'active_support/base64' class HydraWrapper OPTS = {:max_redirects => 3, :timeout => 25000, :method => :post, + :verbose => AppConfig.settings.typhoeus_verbose?, + :ssl_cacert => AppConfig.environment.certificate_authorities.get, :headers => {'Expect' => '', 'Transfer-Encoding' => ''} }