1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# SSL sandbox #!/usr/bin/perl -w ################################ use strict; use IO::Socket; # user IO::Socket::SSL; #################################### # parameter my $host = '192.168.178.103'; my $uname = "foobar"; my $pw = "foobarPW"; my $port = 12621; unless ($sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port,Proto => 'tcp', Timeout => 5)) $sock->print("<Open seq=\"150\" protocolVersion=\"31\" username=\"$uname\" password=\"$pw\"/>\0");
$sock = IO::Socket::SSL->new("$host:$port");
$sock->print(qq{<Open seq="150" protocolVersion="31" username="$uname" password="$pw"/>\0});
$sock = IO::Socket::SSL->new("$host:$port");
$sock->print(qq{<Open seq="150" protocolVersion="31" username="$uname" password="$pw"/>\0});
$tmpParameter=$sock->receive(qq{Open seq="150" protocolVersion="31" username="$uname" password="$pw"/>\0})
my ($buf) = $sock->getlines;
1
2
3
4
my $host = '192.168.10.15'; # Server-IP
my $port = 12621; # Server Port
my $timer = 2; # Timer for Socket
my $sock = IO::Socket::SSL->new("$host:$port",Timeout => $timer); # SSL-Socket
1
2
3
4
5
6
7
8
9
my $host = '192.168.1.15';
my $port = 12621;
my $seqid = "11";
my $uname = "foobar";
my $pw = "FoobarPW";
my $protoVer = 5;
my $timer = 10;
my $sock = IO::Socket::SSL->new(PeerAddr=>$host,PeerPort=>$port,Timeout=>$timer);
$sock->print(qq{<Open seq="$seqid" protocolVersion=$protoVer username="$uname" password="$pw"/>\0});