From 9fba76955e42c37f86c7a1c3ebde3b529a145afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Senart?= Date: Sun, 16 Jul 2023 20:04:04 +0200 Subject: [PATCH] attack: make DefaultTLSConfig.InsecureSkipVerify false MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No reason for it to be true, since the correspondent -insecure flag is false by default. Signed-off-by: Tomás Senart --- lib/attack.go | 2 +- lib/attack_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/attack.go b/lib/attack.go index 5f34f36b..b35eb44b 100644 --- a/lib/attack.go +++ b/lib/attack.go @@ -60,7 +60,7 @@ var ( // DefaultLocalAddr is the default local IP address an Attacker uses. DefaultLocalAddr = net.IPAddr{IP: net.IPv4zero} // DefaultTLSConfig is the default tls.Config an Attacker uses. - DefaultTLSConfig = &tls.Config{InsecureSkipVerify: true} + DefaultTLSConfig = &tls.Config{InsecureSkipVerify: false} ) // NewAttacker returns a new Attacker with default options which are overridden diff --git a/lib/attack_test.go b/lib/attack_test.go index c5149485..290e9a07 100644 --- a/lib/attack_test.go +++ b/lib/attack_test.go @@ -65,7 +65,7 @@ func TestAttackDuration(t *testing.T) { func TestTLSConfig(t *testing.T) { atk := NewAttacker() got := atk.client.Transport.(*http.Transport).TLSClientConfig - if want := (&tls.Config{InsecureSkipVerify: true}); !reflect.DeepEqual(got, want) { + if want := (&tls.Config{InsecureSkipVerify: false}); !reflect.DeepEqual(got, want) { t.Fatalf("got: %+v, want: %+v", got, want) } }