sslcheck 0.9.4.1 → 0.9.5
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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/acceptance/checking_certificates_spec.rb +12 -1
- data/ca-bundle/ca-bundle.crt +3860 -0
- data/lib/sslcheck.rb +2 -0
- data/lib/sslcheck/validators/ca_bundle.rb +12 -1
- data/lib/sslcheck/version.rb +1 -1
- data/spec/ca_bundle_validator_spec.rb +1 -1
- metadata +3 -2
data/lib/sslcheck.rb
CHANGED
@@ -11,9 +11,20 @@ module SSLCheck
|
|
11
11
|
return false if @ca_bundle.empty?
|
12
12
|
|
13
13
|
store = OpenSSL::X509::Store.new
|
14
|
+
store.set_default_paths
|
15
|
+
|
16
|
+
begin
|
17
|
+
store.add_file File.join(SSL_CHECK_ROOT_DIR,'ca-bundle', 'ca-bundle.crt')
|
18
|
+
rescue OpenSSL::X509::StoreError
|
19
|
+
# If the certificate is already present,
|
20
|
+
# we don't really care
|
21
|
+
end
|
14
22
|
|
15
23
|
@ca_bundle.each do |ca_cert|
|
16
|
-
|
24
|
+
begin
|
25
|
+
store.add_cert ca_cert.to_x509
|
26
|
+
rescue OpenSSL::X509::StoreError
|
27
|
+
end
|
17
28
|
end
|
18
29
|
|
19
30
|
store.verify(@peer_cert.to_x509)
|
data/lib/sslcheck/version.rb
CHANGED
@@ -15,7 +15,7 @@ module SSLCheck
|
|
15
15
|
end
|
16
16
|
context "when the certificate cannot be verified by the CA Bundle" do
|
17
17
|
it 'should return errors' do
|
18
|
-
sut = Validators::CABundle.new("npboards.com", @cert, [Certificate.new(
|
18
|
+
sut = Validators::CABundle.new("npboards.com", @cert, [Certificate.new(VALID_CERT)])
|
19
19
|
result = sut.validate
|
20
20
|
expect(result).to be_a SSLCheck::Errors::Validation::CABundleVerification
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sslcheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clayton Lengel-Zigich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- acceptance/checking_certificates_spec.rb
|
113
113
|
- acceptance/client_spec.rb
|
114
114
|
- blinky_tests
|
115
|
+
- ca-bundle/ca-bundle.crt
|
115
116
|
- lib/sslcheck.rb
|
116
117
|
- lib/sslcheck/certificate.rb
|
117
118
|
- lib/sslcheck/certificate_client.rb
|