Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby
All Projects
Ruby
Overview
Activity
Roadmap
Issues
Repository
Like
Download (387 Bytes)
Feature #15353
» client.rb
Test client -
mkauf (Michael Kaufmann)
, 11/28/2018 03:43 PM
require
'socket'
require
'openssl'
ctx
=
OpenSSL
::
SSL
::
SSLContext
.
new
ctx
.
cert
=
OpenSSL
::
X509
::
Certificate
.
new
(
File
.
read
"MyClient1.pem"
)
ctx
.
key
=
OpenSSL
::
PKey
::
RSA
.
new
(
File
.
read
"MyClient1.key"
)
sock
=
TCPSocket
.
new
(
'localhost'
,
1234
)
ssl
=
OpenSSL
::
SSL
::
SSLSocket
.
new
(
sock
,
ctx
)
ssl
.
connect
puts
ssl
.
ssl_version
while
true
do
s
=
ssl
.
gets
break
if
s
.
nil?
puts
s
end
« Previous
1
2
3
…
5
Next »
(1-1/5)
Loading...