⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (394 Bytes)
Bug #14848
ยป verify_callback.rb
aeris (Nicolas Vinot)
, 06/15/2018 10:00 AM
#!/usr/bin/env ruby
require
'net/https'
def
get
(
verify
=
true
,
host
=
'imirhil.fr'
,
port
=
443
)
http
=
Net
::
HTTP
.
new
'imirhil.fr'
,
443
http
.
use_ssl
=
true
http
.
verify_callback
=
lambda
{
|
_
,
_
|
false
}
http
.
verify_mode
=
verify
?
OpenSSL
::
SSL
::
VERIFY_PEER
:
OpenSSL
::
SSL
::
VERIFY_NONE
http
.
get
'/'
end
get
false
# => #<Net::HTTPOK:0x00007f0ee173a040>
get
true
# => OpenSSL::SSL::SSLError
(1-1/1)
Loading...