Accept propper formats for SSL version

we were only accepting sloppy string values and not accepting input of
the actual symbols that OpenSSL expects in the first place. Allow the
user to enter it right themselves to be compat with OpenSSL
bug/bundler_fix
David Maloney 2013-02-09 00:40:58 -06:00
parent 38d0a244fd
commit ebb0f166ca
2 changed files with 9 additions and 1 deletions

View File

@ -140,7 +140,8 @@ class Rex::Socket::Parameters
self.ssl = false
end
if (hash['SSLVersion'] and hash['SSLVersion'].to_s =~ /^(SSL2|SSL3|TLS1)$/i)
supported_ssl_versions = ['SSL2', 'SSL23', 'TLS1', 'SSL3', :SSLv2, :SSLv3, :SSLv23, :TLSv1]
if (hash['SSLVersion'] and supported_ssl_versions.include? hash['SSLVersion'])
self.ssl_version = hash['SSLVersion']
end

View File

@ -65,6 +65,13 @@ begin
version = :SSLv23
when 'TLS1'
version = :TLSv1
# Handle the user supplying the correct syntax themselves
when :SSLv2
version = :SSLv2
when :SSLv23
version = :SSLv23
when :TLSv1
version = :TLSv1
end
end