ssl_labs 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -9
- data/Rakefile +2 -0
- data/lib/ssl_labs.rb +1 -3
- data/lib/ssl_labs/endpoint.rb +1 -1
- data/lib/ssl_labs/endpoint_data.rb +1 -1
- data/lib/ssl_labs/endpoint_data/details.rb +6 -3
- data/lib/ssl_labs/endpoint_data/details/cert.rb +0 -2
- data/lib/ssl_labs/endpoint_data/details/chain.rb +2 -2
- data/lib/ssl_labs/endpoint_data/details/chain_cert.rb +41 -0
- data/lib/ssl_labs/endpoint_data/details/suite.rb +6 -4
- data/lib/ssl_labs/endpoint_data/details/suites.rb +55 -0
- data/lib/ssl_labs/info.rb +1 -1
- data/lib/ssl_labs/version.rb +6 -0
- data/test/test_endpoint_data.rb +1 -2
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e911536b26b35a5b2cef5dceee239996f207bbe
|
4
|
+
data.tar.gz: 5f6e2a04d72df5e0af1b5d01db7f469b6cdf5975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa5492ebcde004e09a293fc31b352d6eb8c600c2dbe93cf176ed12774566bd68a429ae32ca3090d6fa99fd0bdb5348f1543b2c40024803ad1aa2199b76f0a47b
|
7
|
+
data.tar.gz: 97582172d80044be14898499d18f0d1c264ca11bef355a9abd1b0a7b3cdec1b6e0422c8f10def9f1380555b179593d6bb0adac2af5de7fa0d95db01a101a0a0f
|
data/README.md
CHANGED
@@ -11,18 +11,12 @@ The reference client is at https://github.com/ssllabs/ssllabs-scan
|
|
11
11
|
|
12
12
|
* Tests
|
13
13
|
|
14
|
-
* Weirdness:
|
14
|
+
* Weirdness: `#analyze` and `#analyze!` return different things
|
15
15
|
|
16
|
-
* Helper
|
16
|
+
* Helper `#methods?` for boolean attributes
|
17
17
|
|
18
|
-
* SslLabs constructor must take a URI string _with a scheme_
|
19
|
-
|
20
|
-
* Gem version is hardcoded twice
|
18
|
+
* `SslLabs` constructor must take a URI string _with a scheme_
|
21
19
|
|
22
20
|
* `endpoint_data.details.foo` is annoying; remove `details`
|
23
21
|
|
24
22
|
* Configurable poll delay
|
25
|
-
|
26
|
-
* Cert and ChainCert are melded
|
27
|
-
|
28
|
-
* Suites.preference is MIA
|
data/Rakefile
CHANGED
data/lib/ssl_labs.rb
CHANGED
@@ -5,12 +5,10 @@ require 'ssl_labs/api'
|
|
5
5
|
require 'ssl_labs/endpoint_data'
|
6
6
|
require 'ssl_labs/host'
|
7
7
|
require 'ssl_labs/info'
|
8
|
+
require 'ssl_labs/version'
|
8
9
|
|
9
10
|
class SslLabs
|
10
11
|
|
11
|
-
# Gem version.
|
12
|
-
VERSION = '0.0.2'
|
13
|
-
|
14
12
|
# User agent for client.
|
15
13
|
USER_AGENT = "ssl_labs.rb #{VERSION}"
|
16
14
|
|
data/lib/ssl_labs/endpoint.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'ssl_labs/endpoint_data/details/cert'
|
2
2
|
require 'ssl_labs/endpoint_data/details/chain'
|
3
|
+
require 'ssl_labs/endpoint_data/details/chain_cert'
|
3
4
|
require 'ssl_labs/endpoint_data/details/key'
|
4
5
|
require 'ssl_labs/endpoint_data/details/protocol'
|
5
|
-
require 'ssl_labs/endpoint_data/details/
|
6
|
+
require 'ssl_labs/endpoint_data/details/suites'
|
6
7
|
require 'ssl_labs/endpoint_data/details/sim'
|
7
8
|
require 'ssl_labs/util'
|
8
9
|
|
@@ -39,7 +40,7 @@ class SslLabs
|
|
39
40
|
:sni_required,
|
40
41
|
:sts_response_header,
|
41
42
|
:sts_max_age,
|
42
|
-
:
|
43
|
+
:sts_subdomains,
|
43
44
|
:suites,
|
44
45
|
:supports_npn,
|
45
46
|
:supports_rc4,
|
@@ -60,12 +61,14 @@ class SslLabs
|
|
60
61
|
details.host_start_time = Time.at(v / 1000.0)
|
61
62
|
when :key
|
62
63
|
details.key = Key.from_hash(v)
|
64
|
+
when :npn_protocols
|
65
|
+
details.npn_protocols = v.split
|
63
66
|
when :protocols
|
64
67
|
details.protocols = v['list'].map { |hash| Protocol.from_hash(hash) }
|
65
68
|
when :sims
|
66
69
|
details.sims = v['results'].map { |hash| Sim.from_hash(hash) }
|
67
70
|
when :suites
|
68
|
-
details.suites =
|
71
|
+
details.suites = Suites.from_hash(v)
|
69
72
|
when *ATTRS
|
70
73
|
details.send("#{sym}=", v)
|
71
74
|
else
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'ssl_labs/endpoint_data/details/
|
1
|
+
require 'ssl_labs/endpoint_data/details/chain_cert'
|
2
2
|
|
3
3
|
class SslLabs
|
4
4
|
|
@@ -20,7 +20,7 @@ class SslLabs
|
|
20
20
|
hash.each do |k, v|
|
21
21
|
case sym = Util.underscore(k).to_sym
|
22
22
|
when :certs
|
23
|
-
chain.certs = v.map { |cert|
|
23
|
+
chain.certs = v.map { |cert| ChainCert.from_hash(cert) }
|
24
24
|
when *ATTRS
|
25
25
|
chain.send("#{sym}=", v)
|
26
26
|
else
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'ssl_labs/util'
|
2
|
+
|
3
|
+
class SslLabs
|
4
|
+
|
5
|
+
class EndpointData
|
6
|
+
|
7
|
+
class Details
|
8
|
+
|
9
|
+
class ChainCert
|
10
|
+
|
11
|
+
ATTRS = [
|
12
|
+
:issuer_label,
|
13
|
+
:issuer_subject,
|
14
|
+
:issues,
|
15
|
+
:label,
|
16
|
+
:raw,
|
17
|
+
:subject
|
18
|
+
]
|
19
|
+
|
20
|
+
attr_accessor(*ATTRS)
|
21
|
+
|
22
|
+
def self.from_hash(hash)
|
23
|
+
chain_cert = self.new
|
24
|
+
hash.each do |k, v|
|
25
|
+
case sym = Util.underscore(k).to_sym
|
26
|
+
when *ATTRS
|
27
|
+
chain_cert.send("#{sym}=", v)
|
28
|
+
else
|
29
|
+
raise ArgumentError, "Unknown key #{k.inspect} (#{sym.inspect})"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
chain_cert
|
33
|
+
end
|
34
|
+
|
35
|
+
end # ChainCert
|
36
|
+
|
37
|
+
end # Details
|
38
|
+
|
39
|
+
end # EndpointData
|
40
|
+
|
41
|
+
end # SslLabs
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'ssl_labs/endpoint_data/details/suite'
|
2
|
+
require 'ssl_labs/util'
|
3
|
+
|
4
|
+
class SslLabs
|
5
|
+
|
6
|
+
class EndpointData
|
7
|
+
|
8
|
+
class Details
|
9
|
+
|
10
|
+
# Implements a list of ciphersuites. The list is directly accessible
|
11
|
+
# via #list but otherwise Array instance methods called on Suites
|
12
|
+
# are delegated to the list automatically.
|
13
|
+
class Suites
|
14
|
+
|
15
|
+
ATTRS = [
|
16
|
+
:list,
|
17
|
+
:preference
|
18
|
+
]
|
19
|
+
|
20
|
+
attr_accessor(*ATTRS)
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
@list = []
|
24
|
+
end
|
25
|
+
|
26
|
+
def method_missing(method, *args, &blk)
|
27
|
+
[].respond_to?(method) ? @list.send(method, *args, &blk) : super
|
28
|
+
end
|
29
|
+
|
30
|
+
def respond_to?(method)
|
31
|
+
super || [].respond_to?(method)
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.from_hash(hash)
|
35
|
+
suites = self.new
|
36
|
+
hash.each do |k, v|
|
37
|
+
case sym = Util.underscore(k).to_sym
|
38
|
+
when :list
|
39
|
+
suites.list = v.map { |hash| Suite.from_hash(hash) }
|
40
|
+
when *ATTRS
|
41
|
+
suites.send("#{sym}=", v)
|
42
|
+
else
|
43
|
+
raise ArgumentError, "Unknown key #{k.inspect} (#{sym.inspect})"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
suites
|
47
|
+
end
|
48
|
+
|
49
|
+
end # Suites
|
50
|
+
|
51
|
+
end # Details
|
52
|
+
|
53
|
+
end # EndpointData
|
54
|
+
|
55
|
+
end # SslLabs
|
data/lib/ssl_labs/info.rb
CHANGED
data/test/test_endpoint_data.rb
CHANGED
@@ -8,8 +8,7 @@ class TestEndpointData < Test::Unit::TestCase
|
|
8
8
|
|
9
9
|
def test_constructor
|
10
10
|
json = File.read(File.join(File.dirname(__FILE__), 'endpoint_data.json'))
|
11
|
-
|
12
|
-
epd = SslLabs::EndpointData.from_hash(hash)
|
11
|
+
epd = SslLabs::EndpointData.from_json(json)
|
13
12
|
# XXX insert tests here
|
14
13
|
#binding.pry
|
15
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ssl_labs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Carpenter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -67,14 +67,17 @@ files:
|
|
67
67
|
- lib/ssl_labs/endpoint_data/details.rb
|
68
68
|
- lib/ssl_labs/endpoint_data/details/cert.rb
|
69
69
|
- lib/ssl_labs/endpoint_data/details/chain.rb
|
70
|
+
- lib/ssl_labs/endpoint_data/details/chain_cert.rb
|
70
71
|
- lib/ssl_labs/endpoint_data/details/key.rb
|
71
72
|
- lib/ssl_labs/endpoint_data/details/protocol.rb
|
72
73
|
- lib/ssl_labs/endpoint_data/details/sim.rb
|
73
74
|
- lib/ssl_labs/endpoint_data/details/sim/client.rb
|
74
75
|
- lib/ssl_labs/endpoint_data/details/suite.rb
|
76
|
+
- lib/ssl_labs/endpoint_data/details/suites.rb
|
75
77
|
- lib/ssl_labs/host.rb
|
76
78
|
- lib/ssl_labs/info.rb
|
77
79
|
- lib/ssl_labs/util.rb
|
80
|
+
- lib/ssl_labs/version.rb
|
78
81
|
- test/endpoint_data.json
|
79
82
|
- test/test_endpoint_data.rb
|
80
83
|
- Rakefile
|