ssltool 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c74c209bb0253bc39a30cb8244b9eea840820374
4
- data.tar.gz: a33eca2a55b21390fd2e46403ab726b8ea29f31e
3
+ metadata.gz: 610613b7103acc41eb99b6906c13abd33fab9462
4
+ data.tar.gz: f8266de4babff6a3a3977e89ec2ad1afaa7f85ef
5
5
  SHA512:
6
- metadata.gz: 843045d5ed08e5260bd85744696eef0894c4a770b3b080c81027ed453e43eb016a6fe6e3ca00c97b70efb7a1a9de79b64fac67ec4cb1e511116608be9e7bc0f1
7
- data.tar.gz: 6fac592f36eaa5d16ffb8a99dbcc02e2872d428f92c694e5bf7fab8441fe557514affb195a261b6fb19c265fd809990c73a1204d2179598106e39b2732fe39ff
6
+ metadata.gz: 59097c73aeaa0fbdafa955999332548025bd5f065c14a66f4ab3ed067cd35a1c036675d570616503e7b3c987c0653fc8150e57ead319ae270fe8e5bdee187c4c
7
+ data.tar.gz: 9e3749aa4be99f2ad8649d40e96c85f86eeb97a8d6286453bc362fa1afa69299bc0c9f679694f29ab5f926a2195194c287d61d6a11e4327f809b13c4861b8da7
@@ -27,7 +27,7 @@ module SSLTool
27
27
  end
28
28
 
29
29
  def initialize(original_chain, certificate_store)
30
- @original_chain = original_chain.uniq.freeze
30
+ @original_chain = CertificateBundle.new(original_chain.uniq).freeze
31
31
  @certificate_store = certificate_store
32
32
  @domain_certs, @other_certs = @original_chain.partition(&:for_domain_name?)
33
33
  @original_chain.empty? and raise ZeroCertsChainResolutionError
@@ -48,9 +48,14 @@ module SSLTool
48
48
  @ordered = true
49
49
  @trusted = @certificate_store.trust? @resolved_chain
50
50
  @self_signed_untrusted = @resolved_chain.last.self_signed? && !@trusted
51
+ @recommended_chain = case \
52
+ when @originally_ordered && @originally_trusted ; @original_chain
53
+ when @originally_trusted ; @ordered_chain
54
+ else ; self
55
+ end
51
56
  end
52
57
 
53
- attrs = %w[ base_cert domain_names original_chain ordered_chain resolved_chain unused_certs ]
58
+ attrs = %w[ base_cert domain_names original_chain ordered_chain resolved_chain recommended_chain unused_certs ]
54
59
  bools = %w[ originally_ordered originally_trusted ordered trusted self_signed_untrusted ]
55
60
  attr_reader *attrs, *bools
56
61
  bools.each { |m| alias_method "#{m}?", m; private m }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssltool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caio Chassot