httpi 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,7 @@ module HTTPI
42
42
 
43
43
  # Returns an <tt>OpenSSL::X509::Certificate</tt> for the +cert_file+.
44
44
  def cert
45
- @cert ||= OpenSSL::X509::Certificate.new File.read(cert_file)
45
+ @cert ||= OpenSSL::X509::Certificate.new File.read(cert_file) if cert_file
46
46
  end
47
47
 
48
48
  # Sets the +OpenSSL+ certificate.
@@ -58,7 +58,7 @@ module HTTPI
58
58
 
59
59
  # Returns an <tt>OpenSSL::PKey::RSA</tt> for the +cert_key_file+.
60
60
  def cert_key
61
- @cert_key ||= OpenSSL::PKey::RSA.new(File.read(cert_key_file), cert_key_password)
61
+ @cert_key ||= OpenSSL::PKey::RSA.new(File.read(cert_key_file), cert_key_password) if cert_key_file
62
62
  end
63
63
 
64
64
  # Sets the +OpenSSL+ certificate key.
data/lib/httpi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module HTTPI
2
2
 
3
- VERSION = "0.7.5"
3
+ VERSION = "0.7.6"
4
4
 
5
5
  end
@@ -61,12 +61,22 @@ describe HTTPI::Auth::SSL do
61
61
  it "should return an OpenSSL::X509::Certificate for the given cert_file" do
62
62
  ssl.cert.should be_a(OpenSSL::X509::Certificate)
63
63
  end
64
+
65
+ it "should return nil if no cert_file was given" do
66
+ ssl = HTTPI::Auth::SSL.new
67
+ ssl.cert.should be_nil
68
+ end
64
69
  end
65
70
 
66
71
  describe "#cert_key" do
67
72
  it "should return a OpenSSL::PKey::RSA for the given cert_key" do
68
73
  ssl.cert_key.should be_a(OpenSSL::PKey::RSA)
69
74
  end
75
+
76
+ it "should return nil if no cert_key_file was given" do
77
+ ssl = HTTPI::Auth::SSL.new
78
+ ssl.cert_key.should be_nil
79
+ end
70
80
  end
71
81
 
72
82
  describe "#ca_cert" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpi
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease: false
4
+ hash: 15
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 5
10
- version: 0.7.5
9
+ - 6
10
+ version: 0.7.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Harrington
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-12-22 00:00:00 +01:00
19
+ date: 2011-01-03 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  requirements: []
207
207
 
208
208
  rubyforge_project: httpi
209
- rubygems_version: 1.3.7
209
+ rubygems_version: 1.4.1
210
210
  signing_key:
211
211
  specification_version: 3
212
212
  summary: Interface for Ruby HTTP libraries