lib/ronin/network/extensions/ssl/net.rb in ronin-support-0.2.0 vs lib/ronin/network/extensions/ssl/net.rb in ronin-support-0.3.0
- old
+ new
@@ -44,11 +44,17 @@
# @option options [Integer] :local_port
# The local port to bind to.
#
# @option options [Symbol] :verify
# Specifies whether to verify the SSL certificate.
+ # May be one of the following:
#
+ # * `:none`
+ # * `:peer`
+ # * `:client_once`
+ # * `:fail_if_no_peer_cert`
+ #
# @option options [String] :cert
# The path to the SSL certificate.
#
# @option options [String] :key
# The path to the SSL key.
@@ -72,10 +78,10 @@
local_port = options[:local_port]
socket = Net.tcp_connect(host,port,local_host,local_port)
ssl_context = OpenSSL::SSL::SSLContext.new()
- ssl_context.verify_mode = Ronin::Network::SSL.verify(options[:verify])
+ ssl_context.verify_mode = Ronin::Network::SSL::VERIFY[options[:verify]]
if options[:cert]
cert_file = File.new(options[:cert])
ssl_context.cert = OpenSSL::X509::Certificate.new(cert_file)
end