io-endpoint 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/io/endpoint/ssl_endpoint.rb +14 -3
- data/lib/io/endpoint/version.rb +1 -1
- data/lib/io/endpoint.rb +0 -2
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8c719f57ec802f2b04eed41ba8ae7b1a1d50ce90b2d4f0c7188c4b8f62f7306
|
4
|
+
data.tar.gz: dd9bdffdb227f14e4de51d7da5d345ff230b8d05c1da91c41d6f928ce2844a01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8da3c12efc9df9557fdd23d08364a34cde7d89777e078d695fbea2470e3a3a4a30b58d33e0cebaffea0680fd609cdf13a66239f390abe366ae18139eb3860c3
|
7
|
+
data.tar.gz: 0cf5dc1fa569e2f010bdcfdd5351e21ccb0a92055d0af361b7dafae7d0431923556c4673fc6975989211e8cdaf7a449c1f277588d5ae68e78409ac7d5b6bbc30
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -112,17 +112,28 @@ module IO::Endpoint
|
|
112
112
|
@context ||= build_context
|
113
113
|
end
|
114
114
|
|
115
|
+
def make_server(io)
|
116
|
+
::OpenSSL::SSL::SSLServer.new(io, self.context)
|
117
|
+
end
|
118
|
+
|
119
|
+
def make_socket(io)
|
120
|
+
::OpenSSL::SSL::SSLSocket.new(io, self.context).tap do |socket|
|
121
|
+
# We consider the underlying IO is owned by the SSL socket:
|
122
|
+
socket.sync_close = true
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
115
126
|
# Connect to the underlying endpoint and establish a SSL connection.
|
116
127
|
# @yield [Socket] the socket which is being connected
|
117
128
|
# @return [Socket] the connected socket
|
118
129
|
def bind(*arguments, **options, &block)
|
119
130
|
if block_given?
|
120
131
|
@endpoint.bind(*arguments, **options) do |server|
|
121
|
-
yield
|
132
|
+
yield self.make_server(server)
|
122
133
|
end
|
123
134
|
else
|
124
135
|
@endpoint.bind(*arguments, **options).map do |server|
|
125
|
-
|
136
|
+
self.make_server(server)
|
126
137
|
end
|
127
138
|
end
|
128
139
|
end
|
@@ -131,7 +142,7 @@ module IO::Endpoint
|
|
131
142
|
# @yield [Socket] the socket which is being connected
|
132
143
|
# @return [Socket] the connected socket
|
133
144
|
def connect(&block)
|
134
|
-
socket =
|
145
|
+
socket = self.make_socket(@endpoint.connect)
|
135
146
|
|
136
147
|
if hostname = self.hostname
|
137
148
|
socket.hostname = hostname
|
data/lib/io/endpoint/version.rb
CHANGED
data/lib/io/endpoint.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-endpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2024-04-
|
40
|
+
date: 2024-04-23 00:00:00.000000000 Z
|
41
41
|
dependencies: []
|
42
42
|
description:
|
43
43
|
email:
|
metadata.gz.sig
CHANGED
Binary file
|