From fff88188cd07b539077ec369920dd44501a31115 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 26 Nov 2022 05:55:51 +0000 Subject: Fix some broken links in testssl. MkDocs changed the anchor format a while back which broke this. --- tools/testssl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/testssl b/tools/testssl index c64dbf5f0..c93463c74 100755 --- a/tools/testssl +++ b/tools/testssl @@ -73,7 +73,7 @@ It seems like the server endpoint you specified is not reachable! Make sure that * If you are using a firewall incoming connections on TCP port $port are allowed. * The endpoint your server is listening on is not local or private. -See https://docs.inspircd.org/3/configuration/#ltbindgt for more information. +See https://docs.inspircd.org/3/configuration/#bind for more information. EOM exit 1; } @@ -91,7 +91,7 @@ It seems like the server dropped the connection before sending anything! Make su * The endpoint you specified is actually your IRC server. * If you are using a firewall incoming data on TCP port $port are allowed. -See https://docs.inspircd.org/3/configuration/#ltbindgt for more information. +See https://docs.inspircd.org/3/configuration/#bind for more information. EOM exit 1; } elsif ($data =~ /[A-Z:@]/) { @@ -155,7 +155,6 @@ EOM exit 1; } - say <<"EOM"; ${\CC_GREEN}yes${\CC_RESET} -- cgit v1.3.1-10-gc9f91 From 38b70b9e98550157bd12d6d09c4d3e279b671b44 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 26 Nov 2022 06:35:24 +0000 Subject: Fix various edge cases in testssl. - Ignore SIGPIPE to work around IO::Socket::SSL having its socket closed from under it and terminating the program. - Improve detection of servers that close the TCP connection right after it is opened. This usually means the IP address the tool is connecting from has been banned so suggest that as well. - Show more debug information when a connection fails. --- tools/testssl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/testssl b/tools/testssl index c93463c74..13a53f302 100755 --- a/tools/testssl +++ b/tools/testssl @@ -42,6 +42,10 @@ if (scalar @ARGV < 2) { # needs so we disable it. STDOUT->autoflush(1); +# If a server closes the connection whilst an SSL session is being initiated we +# want EPIPE instead of SIGPIPE. +$SIG{PIPE} = 'IGNORE'; + my $hostip = shift @ARGV; if ($hostip =~ /[^A-Za-z0-9.:-]/) { say STDERR "Error: invalid hostname or IP address: $hostip"; @@ -73,6 +77,10 @@ It seems like the server endpoint you specified is not reachable! Make sure that * If you are using a firewall incoming connections on TCP port $port are allowed. * The endpoint your server is listening on is not local or private. +The error provided by the socket library was: + + $IO::Socket::errstr + See https://docs.inspircd.org/3/configuration/#bind for more information. EOM exit 1; @@ -82,7 +90,7 @@ say "${\CC_GREEN}yes${\CC_RESET}"; print "Checking whether ${\CC_BOLD}$hostip/$port${\CC_RESET} is using plaintext ... "; my $error = $sock->recv(my $data, 1); -if ($error) { +if (!defined $error || $data eq '') { say <<"EOM"; ${\CC_RED}error${\CC_RESET} @@ -90,6 +98,7 @@ It seems like the server dropped the connection before sending anything! Make su * The endpoint you specified is actually your IRC server. * If you are using a firewall incoming data on TCP port $port are allowed. + * The IP address you are connecting from has not been banned from the server. See https://docs.inspircd.org/3/configuration/#bind for more information. EOM -- cgit v1.3.1-10-gc9f91