Module: IIRC::SSL
- Defined in:
- lib/iirc.rb
Class Method Summary collapse
- .default_context ⇒ Object
- .no_verify ⇒ Object
- .verify_hostname_only ⇒ Object
- .verify_peer ⇒ Object
- .verify_peer_and_hostname ⇒ Object
Instance Method Summary collapse
- #default_context ⇒ Object private
- #no_verify ⇒ Object private
- #verify_hostname_only ⇒ Object private
- #verify_peer ⇒ Object private
- #verify_peer_and_hostname ⇒ Object private
Class Method Details
.default_context ⇒ Object
82 83 84 |
# File 'lib/iirc.rb', line 82 def default_context verify_peer_and_hostname end |
.no_verify ⇒ Object
105 106 107 108 |
# File 'lib/iirc.rb', line 105 def no_verify require 'openssl' OpenSSL::SSL::SSLContext.new end |
.verify_hostname_only ⇒ Object
99 100 101 102 103 |
# File 'lib/iirc.rb', line 99 def verify_hostname_only no_verify.tap { |context| context.verify_hostname = true } end |
.verify_peer ⇒ Object
92 93 94 95 96 97 |
# File 'lib/iirc.rb', line 92 def verify_peer no_verify.tap { |context| context.verify_mode = OpenSSL::SSL::VERIFY_PEER context.cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths) } end |
.verify_peer_and_hostname ⇒ Object
86 87 88 89 90 |
# File 'lib/iirc.rb', line 86 def verify_peer_and_hostname verify_peer.tap { |context| context.verify_hostname = true } end |
Instance Method Details
#default_context ⇒ Object (private)
82 83 84 |
# File 'lib/iirc.rb', line 82 def default_context verify_peer_and_hostname end |
#no_verify ⇒ Object (private)
105 106 107 108 |
# File 'lib/iirc.rb', line 105 def no_verify require 'openssl' OpenSSL::SSL::SSLContext.new end |
#verify_hostname_only ⇒ Object (private)
99 100 101 102 103 |
# File 'lib/iirc.rb', line 99 def verify_hostname_only no_verify.tap { |context| context.verify_hostname = true } end |
#verify_peer ⇒ Object (private)
92 93 94 95 96 97 |
# File 'lib/iirc.rb', line 92 def verify_peer no_verify.tap { |context| context.verify_mode = OpenSSL::SSL::VERIFY_PEER context.cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths) } end |
#verify_peer_and_hostname ⇒ Object (private)
86 87 88 89 90 |
# File 'lib/iirc.rb', line 86 def verify_peer_and_hostname verify_peer.tap { |context| context.verify_hostname = true } end |