⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (558 Bytes)
Bug #9822
» ssl_example.rb
Test script -
Envek (Andrey Novikov)
, 05/09/2014 08:21 PM
require
'openssl'
require
'socket'
OpenSSL
::
Engine
.
load
gost_engine
=
OpenSSL
::
Engine
.
by_id
(
'gost'
)
gost_engine
.
set_default
(
0xFFFF
)
# It's required, but I don't know why
socket
=
TCPSocket
.
open
(
'ssl-gost.envek.name'
,
443
)
ssl_context
=
OpenSSL
::
SSL
::
SSLContext
.
new
()
ssl_socket
=
OpenSSL
::
SSL
::
SSLSocket
.
new
(
socket
,
ssl_context
)
ssl_socket
.
sync_close
=
true
ssl_socket
.
connect
request
=
<<-
EOR
GET / HTTP/1.1
Host: ssl-gost.envek.name
Connection: close
EOR
# Don't remove blank line above!
ssl_socket
.
puts
(
request
)
puts
ssl_socket
.
read
ssl_socket
.
close
« Previous
1
2
Next »
(2-2/2)
Loading...