mirror of
https://github.com/TwiN/gatus.git
synced 2024-12-22 14:41:01 +01:00
fix(tls): add test for insecure flag
adds tests to complement work done in https://github.com/TwiN/gatus/pull/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
This commit is contained in:
parent
83a555e334
commit
64ad34a96f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user