localhost 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/localhost/authority.rb +22 -2
- data/lib/localhost/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3aedd0578ec88a4e5f4e8a4f485607ff16a4a132e0f5c5cebdc3c80e29ade744
|
4
|
+
data.tar.gz: c6aa53e08063c1202b60148a04ae1391aa42c9cdbefe920723bf641a9f969741
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b8cbd0e0db9d5d1368f768c3171e0dac6217d6b5a400e33678028844bb1643604eaa8633552b61e018892e6cb98af9e3de5b0db6ae90111169b03f906667ce4
|
7
|
+
data.tar.gz: 5cef990c8f1d88a315a4429274463ebf04ed63c5251a895eeb1bc1f9f97c50ef907f20e52b75b28dd919e9e363690eca6e71b7a21c558968caf631c7e81d4c1d
|
data/lib/localhost/authority.rb
CHANGED
@@ -49,8 +49,18 @@ module Localhost
|
|
49
49
|
@store = nil
|
50
50
|
end
|
51
51
|
|
52
|
+
BITS = 1024*2
|
53
|
+
|
54
|
+
def ecdh_key
|
55
|
+
@ecdh_key ||= OpenSSL::PKey::EC.new "prime256v1"
|
56
|
+
end
|
57
|
+
|
58
|
+
def dh_key
|
59
|
+
@dh_key ||= OpenSSL::PKey::DH.new(BITS)
|
60
|
+
end
|
61
|
+
|
52
62
|
def key
|
53
|
-
@key ||= OpenSSL::PKey::RSA.new(
|
63
|
+
@key ||= OpenSSL::PKey::RSA.new(BITS)
|
54
64
|
end
|
55
65
|
|
56
66
|
def key= key
|
@@ -111,6 +121,16 @@ module Localhost
|
|
111
121
|
|
112
122
|
context.session_id_context = "localhost"
|
113
123
|
|
124
|
+
if context.respond_to? :tmp_dh_callback=
|
125
|
+
context.tmp_dh_callback = proc {self.dh_key}
|
126
|
+
end
|
127
|
+
|
128
|
+
if context.respond_to? :ecdh_curves=
|
129
|
+
context.ecdh_curves = 'P-256:P-384:P-224:P-521'
|
130
|
+
elsif context.respond_to? :tmp_ecdh_callback=
|
131
|
+
context.tmp_ecdh_callback = proc {self.ecdh_key}
|
132
|
+
end
|
133
|
+
|
114
134
|
context.set_params(
|
115
135
|
ciphers: SERVER_CIPHERS
|
116
136
|
)
|
@@ -128,7 +148,7 @@ module Localhost
|
|
128
148
|
end
|
129
149
|
|
130
150
|
def load(path)
|
131
|
-
if File.directory? path
|
151
|
+
if File.directory? path
|
132
152
|
certificate_path = File.join(path, "#{@hostname}.crt")
|
133
153
|
key_path = File.join(path, "#{@hostname}.key")
|
134
154
|
|
data/lib/localhost/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: localhost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.7.
|
93
|
+
rubygems_version: 2.7.6
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Manage a local certificate authority for self-signed localhost development
|