diff options
author | Richard Levitte <levitte@openssl.org> | 2018-01-18 10:54:48 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2018-01-18 10:56:20 +0100 |
commit | e02d5886636095c26a8bff1bf8344bd0bba7ccff (patch) | |
tree | ebea023bc1af55560e7a56c5e78566e02bb58f80 /util | |
parent | doc: Bad prototypes of EVP_PKEY_CTX_new() (diff) | |
download | openssl-e02d5886636095c26a8bff1bf8344bd0bba7ccff.tar.xz openssl-e02d5886636095c26a8bff1bf8344bd0bba7ccff.zip |
TLSProxy::Proxy: Don't use ReuseAddr on Windows
On Windows, we sometimes see a behavior with SO_REUSEADDR where there
remains lingering listening sockets on the same address and port as a
newly created one.
An easy solution is not to use ReuseAddr on Windows.
Thanks Bernd Edlinger for the suggestion.
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5103)
Diffstat (limited to 'util')
-rw-r--r-- | util/perl/TLSProxy/Proxy.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/util/perl/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm index c29f44056f..8c7b6d6a82 100644 --- a/util/perl/TLSProxy/Proxy.pm +++ b/util/perl/TLSProxy/Proxy.pm @@ -189,13 +189,15 @@ sub clientstart # Create the Proxy socket my $proxaddr = $self->proxy_addr; $proxaddr =~ s/[\[\]]//g; # Remove [ and ] - my $proxy_sock = $IP_factory->( + my @proxyargs = ( LocalHost => $proxaddr, LocalPort => $self->proxy_port, Proto => "tcp", Listen => SOMAXCONN, - ReuseAddr => 1 - ); + ); + push @proxyargs, ReuseAddr => 1 + unless $^O eq "MSWin32"; + my $proxy_sock = $IP_factory->(@proxyargs); if ($proxy_sock) { print "Proxy started on port ".$self->proxy_port."\n"; |