Module: Ronin::Network::SSL

Defined in:
lib/ronin/network/ssl.rb

Overview

SSL helper methods.

Constant Summary collapse

VERIFY =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Maps SSL verify modes to OpenSSL::SSL::VERIFY_* constants.

Returns:

Since:

  • 1.3.0

Hash.new do |hash,key|
  verify_const = if key
                   "VERIFY_#{key.to_s.upcase}"
                 else
                   'VERIFY_NONE'
                 end

  unless OpenSSL::SSL.const_defined?(verify_const)
    raise(RuntimeError,"unknown verify mode #{key}")
  end

  hash[key] = OpenSSL::SSL.const_get(verify_const)
end