Commit fa9dc509 authored by Richard Levitte's avatar Richard Levitte
Browse files

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: default avatarBernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5092)

(cherry picked from commit c44bab08)
parent baa5d0ed
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -156,6 +156,9 @@ sub start
            ." s_server -no_comp -rev -engine ossltest -accept "
            .($self->server_port)
            ." -cert ".$self->cert." -naccept ".$self->serverconnects;
        unless ($self->supports_IPv6) {
            $execcmd .= " -4";
        }
        if ($self->ciphers ne "") {
            $execcmd .= " -cipher ".$self->ciphers;
        }
@@ -217,6 +220,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;
            }