Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to skip cert verification on HTTPS checks #1897

Closed
wants to merge 1 commit into from
Closed

Adding ability to skip cert verification on HTTPS checks #1897

wants to merge 1 commit into from

Conversation

hairyhenderson
Copy link

This adds support for a new environment variable
CONSUL_CHECK_HTTP_SSL_SKIP_VERIFY, which will cause TLS cert
verification to be skipped when performing HTTPS service checks.

Right now, if I try to do an HTTP check against an
https://<private_ip> URL, the check will fail with something like:

... x509: cannot validate certificate for x.x.x.x because it doesn't
contain any IP SANs

Sometimes it's not possible to use the FQDN that the cert is valid for,
because it may be (for example) fronted by a load-balancer, whereas we
want to check the particular instance of a service.

Signed-off-by: Dave Henderson dhenderson@gmail.com

This adds support for a new environment variable
`CONSUL_CHECK_HTTP_SSL_SKIP_VERIFY`, which will cause TLS cert
verification to be skipped when performing HTTPS service checks.

Right now, if I try to do an HTTP check against an
`https://<private_ip>` URL, the check will fail with something like:

```
... x509: cannot validate certificate for x.x.x.x because it doesn't
contain any IP SANs
```

Sometimes it's not possible to use the FQDN that the cert is valid for,
because it may be (for example) fronted by a load-balancer, whereas we
want to check the particular instance of a service.

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@slackpad
Copy link
Contributor

Hi @hairyhenderson thanks for the PR! Instead of an environment variable that applies to all checks it seems like this would be better as a new Boolean field in https://github.com/hashicorp/consul/blob/master/command/agent/check.go#L43 so it could be configured per-check. If the sense of the field is "skip" then it will default to false for existing checks and do the right thing.

@hairyhenderson
Copy link
Author

Thanks for the feedback, @slackpad - that's a good idea. I'll incorporate that :)

@ryanuber
Copy link
Member

ryanuber commented Jul 5, 2016

Thanks @hairyhenderson, appreciate the contribution! I'm going to close this in favor of #1984. I agree with @slackpad that this fits better as a parameter of the check definition.

@ryanuber ryanuber closed this Jul 5, 2016
@hairyhenderson hairyhenderson deleted the support-skip-tls-verify-on-checks branch July 7, 2016 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants