Skip to content

Commit

Permalink
Files for SSL config (certs, etc) were not closed. closes nahi#8.
Browse files Browse the repository at this point in the history
  • Loading branch information
nahi committed Nov 2, 2009
1 parent d24ab1d commit c737a84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/httpclient/ssl_config.rb
Expand Up @@ -112,8 +112,8 @@ def client_key=(client_key)
#
# Calling this method resets all existing sessions.
def set_client_cert_file(cert_file, key_file)
@client_cert = X509::Certificate.new(File.open(cert_file).read)
@client_key = PKey::RSA.new(File.open(key_file).read)
@client_cert = X509::Certificate.new(File.open(cert_file) { |f| f.read })
@client_key = PKey::RSA.new(File.open(key_file) { |f| f.read })
change_notify
end

Expand Down Expand Up @@ -158,7 +158,7 @@ def set_trust_ca(trust_ca_file_or_hashed_dir)
# Calling this method resets all existing sessions.
def set_crl(crl)
unless crl.is_a?(X509::CRL)
crl = X509::CRL.new(File.open(crl).read)
crl = X509::CRL.new(File.open(crl) { |f| f.read })
end
@cert_store.add_crl(crl)
@cert_store.flags = X509::V_FLAG_CRL_CHECK | X509::V_FLAG_CRL_CHECK_ALL
Expand Down

0 comments on commit c737a84

Please sign in to comment.