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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/uninterruptible/tls_server_factory.rb +19 -1
- data/lib/uninterruptible/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec0c8eaf7fcd4e6be024f10c74ea412c7b2e1c4a
|
4
|
+
data.tar.gz: 4dc641d56fcbdbf69237db8366ad89e094fd4008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 445bb79aef41ed50720a674fc9df82461eed9a63231648d53fe4cb567cc9900638f359709f060712c8c332a47596d1be9971e676b63d417d03bf060abc659af2
|
7
|
+
data.tar.gz: c72b8005bd3a954ad35d98555566e3fcdb67055b2b7d6b1764273515ec4f4864e9bf150b5260b56d95a16588ce692b14538e16687b386678cb9d4938b0b13a17
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|
|
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.
|
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-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|