Skip to content

Commit 9aeb8e7

Browse files
committed
followed origin/master changes
1 parent 56679f2 commit 9aeb8e7

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

lib/httpclient/ssl_config.rb

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ def initialize(client)
146146
return unless SSLEnabled
147147
@client = client
148148
@cert_store = X509::Store.new
149-
@cert_store.set_default_paths
150-
@cacerts_loaded = working_openssl_platform?
151-
152149
@cert_store_crl_items = []
153150
@client_cert = @client_key = @client_key_pass = @client_ca = nil
154151
@verify_mode = SSL::VERIFY_PEER | SSL::VERIFY_FAIL_IF_NO_PEER_CERT
@@ -165,6 +162,7 @@ def initialize(client)
165162
@options |= OpenSSL::SSL::OP_NO_SSLv3 if defined?(OpenSSL::SSL::OP_NO_SSLv3)
166163
# OpenSSL 0.9.8 default: "ALL:!ADH:!LOW:!EXP:!MD5:+SSLv2:@STRENGTH"
167164
@ciphers = CIPHERS_DEFAULT
165+
@cacerts_loaded = false
168166
end
169167

170168
# Sets certificate and private key for SSL client authentication.
@@ -415,21 +413,10 @@ def change_notify
415413
nil
416414
end
417415

418-
def working_openssl_platform?
419-
File.exist?(OpenSSL::X509::DEFAULT_CERT_FILE) && Dir.exist?(OpenSSL::X509::DEFAULT_CERT_DIR)
420-
end
421-
422416
# Use 2048 bit certs trust anchor
423417
def load_cacerts(cert_store)
424-
certs = if ENV.key?('SSL_CERT_DIR'.freeze) || ENV.key?('SSL_CERT_FILE')
425-
[ ENV['SSL_CERT_DIR'], ENV['SSL_CERT_FILE'] ].compact
426-
else
427-
[ File.join(File.dirname(__FILE__), 'cacert.pem') ]
428-
end
429-
430-
certs.each do |cert|
431-
add_trust_ca_to_store(cert_store, cert)
432-
end
418+
file = File.join(File.dirname(__FILE__), 'cacert.pem')
419+
add_trust_ca_to_store(cert_store, file)
433420
end
434421
end
435422

test/helper.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
66
SimpleCov.start
77
rescue LoadError
8-
end if ENV['CI']
9-
8+
end
109
require 'test/unit'
1110

1211
require 'httpclient'

test/test_httpclient.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require File.expand_path('helper', File.dirname(__FILE__))
33
require 'tempfile'
44

5+
56
class TestHTTPClient < Test::Unit::TestCase
67
include Helper
78
include HTTPClient::Util
@@ -416,6 +417,7 @@ def test_cookie_update_while_authentication
416417
end
417418
end
418419

420+
419421
def test_proxy_ssl
420422
escape_noproxy do
421423
@client.proxy = 'http://admin:admin@localhost:8080/'

0 commit comments

Comments
 (0)