summaryrefslogtreecommitdiffstats
path: root/util/perl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-01-16 19:50:10 +0100
committerRichard Levitte <levitte@openssl.org>2018-01-17 09:26:42 +0100
commitc44bab084ed139b5e5c3f6b318bf1bf65e04cfa5 (patch)
tree84a5883dd55522fb260ce199975c2e352e5b951e /util/perl
parent61f805c1d52358778fd77b239f24b6f64f1e2c6e (diff)
TLSProxy::Proxy: If we don't support IPv6, force IPv4
We use the first we can of the following IO::Socket modules to create sockets: - IO::Socket::INET6 - IO::Socket::IP - IO::Socket::INET The last of them doesn't support IPv6, so if that's the one available, we must force the s_client and s_server processes to use IPv4. Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/5092)
Diffstat (limited to 'util/perl')
-rw-r--r--util/perl/TLSProxy/Proxy.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/perl/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm
index d778d0e70d..a87675c5ca 100644
--- a/util/perl/TLSProxy/Proxy.pm
+++ b/util/perl/TLSProxy/Proxy.pm
@@ -167,6 +167,9 @@ sub start
.($self->server_port)
." -cert ".$self->cert." -cert2 ".$self->cert
." -naccept ".$self->serverconnects;
+ unless ($self->supports_IPv6) {
+ $execcmd .= " -4";
+ }
if ($self->ciphers ne "") {
$execcmd .= " -cipher ".$self->ciphers;
}
@@ -228,6 +231,9 @@ sub clientstart
my $execcmd = "echo ".$echostr." | ".$self->execute
." s_client -engine ossltest -connect "
.($self->proxy_addr).":".($self->proxy_port);
+ unless ($self->supports_IPv6) {
+ $execcmd .= " -4";
+ }
if ($self->cipherc ne "") {
$execcmd .= " -cipher ".$self->cipherc;
}