]>
git.ipfire.org Git - thirdparty/openssl.git/blob - test/recipes/90-test_networking.t
2 # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
10 use OpenSSL
::Test qw
/:DEFAULT cmdstr srctop_file bldtop_file bldtop_dir/;
11 use OpenSSL
::Test
::Utils
;
14 my $test_name = "test_networking";
17 plan skip_all
=> "TLSProxy isn't usable on $^O"
18 if $^O
=~ /^(VMS|MSWin32)$/;
20 plan skip_all
=> "$test_name needs the dynamic engine feature enabled"
21 if disabled
("engine") || disabled
("dynamic-engine");
23 plan skip_all
=> "$test_name needs the sock feature enabled"
26 $ENV{OPENSSL_ia32cap
} = '~0x200000200000000';
28 my $proxy = TLSProxy
::Proxy
->new(
30 cmdstr
(app
(["openssl"]), display
=> 1),
31 srctop_file
("apps", "server.pem"),
32 (!$ENV{HARNESS_ACTIVE
} || $ENV{HARNESS_VERBOSE
})
39 $proxy->serverflags("-4");
40 $proxy->clientflags("-4");
41 $proxy->server_addr("127.0.0.1");
42 $proxy->proxy_addr("127.0.0.1");
43 ok
(check_connection
(), "Trying IPv4");
46 skip
"No IPv6 support", 1 unless $proxy->supports_IPv6();
50 $proxy->serverflags("-6");
51 $proxy->clientflags("-6");
52 $proxy->server_addr("[::1]");
53 $proxy->proxy_addr("[::1]");
54 ok
(check_connection
(), "Trying IPv6");
59 eval { $proxy->start(); };
62 print STDERR
"Proxy connection failed: $@\n";