Skip to content

Commit

Permalink
test(client): add test for insecure flag (#942)
Browse files Browse the repository at this point in the history
adds tests to complement work done in
#547

it was rumored that tls insecure was not working,
although tls insecure appears to be working fine,
no test was found originally.

this adds a test to ensure that tls insecure works
as expected. the domain badssl.com is used to
verify that the insecure flag works as expected
  • Loading branch information
pnikonowicz authored Dec 27, 2024
1 parent 0440deb commit 78c9a1b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,24 @@ func TestCanPerformTLS(t *testing.T) {
wantConnected: true,
wantErr: false,
},
{
name: "bad cert with insecure true",
args: args{
address: "expired.badssl.com:443",
insecure: true,
},
wantConnected: true,
wantErr: false,
},
{
name: "bad cert with insecure false",
args: args{
address: "expired.badssl.com:443",
insecure: false,
},
wantConnected: false,
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 78c9a1b

Please sign in to comment.