2 # Before `make install' is performed this script should be runnable with
3 # `make test'. After `make install' it should work as `perl t/compatibility.t'
7 eval {require "t/ssl_settings.req";} ||
8 eval {require "ssl_settings.req";};
13 if (/MacOS/ or /VOS/ or /vmesa/ or /riscos/ or /amigaos/) {
14 print "1..0 # Skipped: fork not implemented on this platform\n";
19 $SIG{'CHLD'} = "IGNORE";
22 IO::Socket::SSL::context_init(SSL_verify_mode => 0x01, SSL_version => 'TLSv1' );
25 my $server = IO::Socket::INET->new(
26 LocalAddr => $SSL_SERVER_ADDR,
28 Proto => 'tcp', ReuseAddr => 1, Timeout => 15
33 print("Setup of test IO::Socket::INET client and server failed. All the rest of ",
34 "the tests in this suite will fail also unless you change the values in ",
35 "ssl_settings.req in the t/ directory.");
39 my ($SSL_SERVER_PORT) = unpack_sockaddr_in( $server->sockname );
45 $MyClass::client = new IO::Socket::INET("$SSL_SERVER_ADDR:$SSL_SERVER_PORT");
48 @ISA = "IO::Socket::SSL";
49 MyClass->start_SSL($client) || print "not ";
51 (ref($client) eq "MyClass") || print "not ";
53 $client->issuer_name || print "not ";
55 $client->subject_name || print "not ";
57 $client->opened || print "not ";
59 print $client "Ok to close\n";
64 my $contact = $server->accept;
66 IO::Socket::SSL::socketToSSL($contact,
68 SSL_verify_mode => 0}) || print "not ";
74 bless $contact, "MyClass";
75 print "not " if IO::Socket::SSL::socket_to_SSL($contact, SSL_server => 1);
78 print "not " unless (ref($contact) eq "MyClass");
82 print "Bail Out! $IO::Socket::SSL::ERROR";