Skip to content

Commit

Permalink
Change: Only log SSL/TLS failure once per script
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnoStiefvater committed Nov 8, 2021
1 parent b85698b commit dfe7473
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions misc/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ socket_negotiate_ssl (int fd, openvas_encaps_t transport,
openvas_connection *fp;
kb_t kb;
char buf[1024];
static gboolean connection_failed_msg_sent = FALSE; // send msg only once

if (!fd_is_stream (fd))
{
Expand All @@ -817,9 +818,13 @@ socket_negotiate_ssl (int fd, openvas_encaps_t transport,
g_free (key);
g_free (passwd);
g_free (cafile);
g_message ("Function socket_negotiate_ssl called from %s: "
"SSL/TLS connection failed.",
nasl_get_plugin_filename ());
if (!connection_failed_msg_sent)
{
g_message ("Function socket_negotiate_ssl called from %s: "
"SSL/TLS connection failed.",
nasl_get_plugin_filename ());
connection_failed_msg_sent = TRUE;
}
release_connection_fd (fd, 0);
return -1;
}
Expand Down

0 comments on commit dfe7473

Please sign in to comment.