lib/rex/socket/parameters.rb in librex-0.0.32 vs lib/rex/socket/parameters.rb in librex-0.0.33
- old
+ new
@@ -61,10 +61,14 @@
#
# SSLVersion
#
# Specify SSL2, SSL3, or TLS1 (SSL3 is default)
#
+ # SSLCert
+ #
+ # A file containing an SSL certificate (for server sockets)
+ #
# Proxies
#
# List of proxies to use.
#
# Proto
@@ -137,10 +141,18 @@
if (hash['SSLVersion'] and hash['SSLVersion'].to_s =~ /^(SSL2|SSL3|TLS1)$/i)
self.ssl_version = hash['SSLVersion']
end
+ if (hash['SSLCert'] and ::File.file?(hash['SSLCert']))
+ begin
+ self.ssl_cert = ::File.read(hash['SSLCert'])
+ rescue ::Exception => e
+ elog("Failed to read cert: #{e.class}: #{e}", LogSource)
+ end
+ end
+
if hash['Proxies']
self.proxies = hash['Proxies'].split('-').map{|a| a.strip}.map{|a| a.split(':').map{|b| b.strip}}
end
# The protocol this socket will be using
@@ -322,9 +334,13 @@
attr_accessor :ssl
#
# What version of SSL to use (SSL2, SSL3, TLS1)
#
attr_accessor :ssl_version
+ #
+ # The SSL certificate, in pem format, stored as a string. See +SslTcpServer#make_ssl+
+ #
+ attr_accessor :ssl_cert
#
# Whether we should use IPv6
#
attr_accessor :v6