uninterruptible 2.2.0 → 2.2.1

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: 42e77ed731e5fa9282a2ae7976a81c8cebf3ca30
4
- data.tar.gz: 7914f883f7209fabae8fb8a0e7309b76506f0e16
3
+ metadata.gz: ec0c8eaf7fcd4e6be024f10c74ea412c7b2e1c4a
4
+ data.tar.gz: 4dc641d56fcbdbf69237db8366ad89e094fd4008
5
5
  SHA512:
6
- metadata.gz: 1c9d0f312b9d34745710d1c930bd275b633eb20d8b85ad387cf3b3bca75fa551189ac6a2291624a2f308a8cfcab70016411af6eccc7884cabf6ad3ff689e1990
7
- data.tar.gz: 7ad3f76b3eb6fca1399aac4c9ba8554bf1677967ba5942d0917444eb0e6249ec44b198253a1d94dafe36419787d8a0ae5857863a7739c202b9aa8fd27c9692b0
6
+ metadata.gz: 445bb79aef41ed50720a674fc9df82461eed9a63231648d53fe4cb567cc9900638f359709f060712c8c332a47596d1be9971e676b63d417d03bf060abc659af2
7
+ data.tar.gz: c72b8005bd3a954ad35d98555566e3fcdb67055b2b7d6b1764273515ec4f4864e9bf150b5260b56d95a16588ce692b14538e16687b386678cb9d4938b0b13a17
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ # 2.2.1
4
+ * Allow multiple certificates to be used in one build file
5
+
3
6
  # 2.2.0
4
7
  * Verify client TLS certificates
5
8
  * Allow trusted client CA to be set
@@ -4,6 +4,20 @@ module Uninterruptible
4
4
  class TLSServerFactory
5
5
  attr_reader :configuration
6
6
 
7
+ # Extracts pulling multiple certificates out of one file
8
+ class CertificateChain
9
+ attr_reader :cert_file
10
+
11
+ def initialize(cert_file)
12
+ @cert_file = cert_file
13
+ end
14
+
15
+ def to_a
16
+ certs = cert_file.scan(/-----BEGIN CERTIFICATE-----.+?-----END CERTIFICATE-----/m)
17
+ certs.map { |cert| OpenSSL::X509::Certificate.new(cert) }
18
+ end
19
+ end
20
+
7
21
  # @param [Uninterruptible::Configuration] configuration Object with valid TLS configuration options
8
22
  #
9
23
  # @raise [Uninterruptible::ConfigurationError] Correct options are not set for TLS
@@ -30,7 +44,11 @@ module Uninterruptible
30
44
  # @return [OpenSSL::SSL::SSLContext] SSL context for the server config
31
45
  def ssl_context
32
46
  context = OpenSSL::SSL::SSLContext.new
33
- context.cert = OpenSSL::X509::Certificate.new(configuration.tls_certificate)
47
+
48
+ certificates = CertificateChain.new(configuration.tls_certificate).to_a
49
+ context.cert = certificates.shift
50
+ context.extra_chain_cert = certificates # Remaining certificataes that aren't the primary. Could be empty.
51
+
34
52
  context.key = OpenSSL::PKey::RSA.new(configuration.tls_key)
35
53
  context.ssl_version = configuration.tls_version.to_sym
36
54
 
@@ -1,3 +1,3 @@
1
1
  module Uninterruptible
2
- VERSION = "2.2.0".freeze
2
+ VERSION = "2.2.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uninterruptible
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Wentworth
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-01 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler