rex-socket 0.1.12 → 0.1.13

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: 2f7be9a5921f70d75641dc2356ede27c47e38f7b
4
- data.tar.gz: 39aa328105ad28c50e3ca44ad8a6692800dca622
3
+ metadata.gz: e03fb63e7486cc7a61cc293d0dbb37393498c616
4
+ data.tar.gz: 683f42beeb59df6ce2b424a206aa26790108d163
5
5
  SHA512:
6
- metadata.gz: 5bd2c349091a42d5b16e6823ddef15435a55ba3aeb7852628ea769ab1f3b16ce12afb457effd4b989fc89a33fc23fc36b51ec803dc79b15b702908d575ded5aa
7
- data.tar.gz: b2788b704b6a52759e427b197f77db7fdee9f5ee2ee418ad8801b7a15b2cf474b54e4062bc570683f5659755e979f441f25f38f0218f3deba5b327cc9a366c2e
6
+ metadata.gz: 1e374551466dfb1faed2dffb38848a951d306e93206611b3d4cbefc2ecc0cfc5d6d2e69d18871679c6b4734809f66ea46c7d7019a99199b7df047359b01a58b7
7
+ data.tar.gz: d98c67986b353ccb5078ceb6a572fe2f40616b7c6f614b4d5855fdf09ca2ec89d2d1f7defd51ff9e6b0a3f63f400843048b329121a499f549dbb07dedae9fcf4
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -43,6 +43,22 @@ begin
43
43
  #
44
44
  ##
45
45
 
46
+ def self.system_ssl_methods
47
+ ssl_context = OpenSSL::SSL::SSLContext
48
+ if ssl_context.const_defined? :METHODS_MAP
49
+ ssl_context.const_get(:METHODS_MAP).keys
50
+ else
51
+ ssl_context::METHODS
52
+ end
53
+ end
54
+
55
+ def self.supported_ssl_methods
56
+ @@methods ||= ['Auto', 'TLS'] + system_ssl_methods
57
+ .reject { |method| method.match(/server|client/) }
58
+ .select {|m| OpenSSL::SSL::SSLContext.new(m) && true rescue false} \
59
+ .map {|m| m.to_s.sub(/v/, '').sub('_', '.')}
60
+ end
61
+
46
62
  #
47
63
  # Initializes the SSL socket.
48
64
  #
@@ -72,8 +88,9 @@ begin
72
88
  end
73
89
 
74
90
  # Raise an error if no selected versions are supported
75
- if ! OpenSSL::SSL::SSLContext::METHODS.include? version
76
- raise ArgumentError, 'The system OpenSSL does not support the requested SSL/TLS version'
91
+ unless Rex::Socket::SslTcp.system_ssl_methods.include? version
92
+ raise ArgumentError,
93
+ "This version of Ruby does not support the requested SSL/TLS version #{params.ssl_version}"
77
94
  end
78
95
 
79
96
  # Try intializing the socket with this SSL/TLS version
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Socket
3
- VERSION = "0.1.12"
3
+ VERSION = "0.1.13"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Maloney
@@ -88,7 +88,7 @@ cert_chain:
88
88
  G+Hmcg1v810agasPdoydE0RTVZgEOOMoQ07qu7JFXVWZ9ZQpHT7qJATWL/b2csFG
89
89
  8mVuTXnyJOKRJA==
90
90
  -----END CERTIFICATE-----
91
- date: 2018-03-21 00:00:00.000000000 Z
91
+ date: 2018-03-26 00:00:00.000000000 Z
92
92
  dependencies:
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: bundler
metadata.gz.sig CHANGED
Binary file