Fix federation with GnuTLS by passing the ca_file to Typhoeus
How did this ever work? Anyway Diaspora now works with libcurl4-gnutls-dev which already supports SNI in most distributions and is also the default for many distros. Everybody should switch to it. Do so by installing it and then do a gem uninstall typhoeus followed by a bundle to compile it with GnuTLS
This commit is contained in:
parent
4cf48cae6b
commit
640a0181ab
2 changed files with 23 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ require 'active_support/base64'
|
|||
class HydraWrapper
|
||||
|
||||
OPTS = {:max_redirects => 3, :timeout => 25000, :method => :post,
|
||||
:ssl_capath => EnviromentConfiguration.ca_cert_file_location,
|
||||
:headers => {'Expect' => '',
|
||||
'Transfer-Encoding' => ''}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# licensed under the Affero General Public License version 3 or later. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
require 'hydra_wrapper'
|
||||
require 'spec_helper'
|
||||
|
||||
describe HydraWrapper do
|
||||
before do
|
||||
|
|
@ -74,6 +74,27 @@ describe HydraWrapper do
|
|||
|
||||
end
|
||||
|
||||
describe "#insert_job" do
|
||||
before do
|
||||
@wrapper.hydra.stub!(:queue)
|
||||
@wrapper.stub!(:prepare_request!)
|
||||
end
|
||||
|
||||
it 'passes the correct options' do
|
||||
xml = "<XML>"
|
||||
url = "blub"
|
||||
Typhoeus::Request.should_receive(:new).with(url, {
|
||||
:max_redirects => 3, :timeout => 25000, :method => :post,
|
||||
#:ssl_capath => EnvironmentConfiguration.
|
||||
:headers => {'Expect' => '',
|
||||
'Transfer-Encoding' => ''},
|
||||
:ssl_capath => EnviromentConfiguration.ca_cert_file_location,
|
||||
:params => {:xml => CGI.escape(xml)}
|
||||
})
|
||||
@wrapper.insert_job(url, xml, stub)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#redirecting_to_https?!' do
|
||||
it 'does not execute unless response has a 3xx code' do
|
||||
resp = stub(:code => 200)
|
||||
|
|
|
|||
Loading…
Reference in a new issue