Repository navigation
|
I'd like to configure an endpoint to expect a TLS failure, i.e. accessing a service configured for mTLS should fail when accessing the endpoint without a certificate. The TLS check succeeds despite the TLS errror, which is great, because I can check the certificate expiry without adding a client certificate to gatus. The https check creates an error but will succeed, when I add the condition It also shows (as expected)
I tried a naive approach hoping the placeholder from some alerts might be available:
Unfortunately it's not and I couldn't find a specific condition. Is there a way to configure this negative mTLS check I'm overlooking? I'd like the check to be more specific than connected = false because that would also trigger for other connection failures. |
Replies: 1 comment 1 reply
|
There's no placeholder for the error text (the list is endpoints:
- name: mtls-rejects-anonymous
url: "tls://example.com:443"
body: "GET / HTTP/1.0\r\n\r\n"
conditions:
- "[CONNECTED] == true"
- "has([BODY]) == false"Why this works:
I checked those three cases against a local Go TLS 1.3 server with Caveats:
If you want to match on the exact error, that would need a new placeholder, which is probably worth a feature request. |
There's no placeholder for the error text (the list is
[STATUS],[RESPONSE_TIME],[IP],[BODY],[CONNECTED],[CERTIFICATE_EXPIRATION],[DOMAIN_EXPIRATION],[DNS_RCODE]), so[RESULT_ERRORS]can't work. But you can get a more specific check than[CONNECTED] == falsewith atls://endpoint that sends a body:Why this works:
certificate requiredis a TLS 1.3 alert. In TLS 1.3 the client finishes its side of the handshake before the server checks for a client cert, and the alert only arrives on the first rea…