-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
x509_cert: allow specifying target hostname #6809
Comments
My first instinct is that we shouldn't do this, we are essentially asking the plugin to report an invalid certificate as valid. It seems to me that the system offering the certificate should serve it on the correct CN or SAN. Workarounds could be modifying dns lookup (for example I'll leave this open for further discussion. |
openssl s_client can do this. This check valid certificate on specified host and no reason to add individual host names to SAN as they never used. There can be many different names identified by SNI. If hosts balanced you can't connect exactly to one of them. If SNI checked you won't ever connect |
It sounds like we need more control for SNI. Something like this would be backwards compatibile with the current settings, does this have the expected control? [[inputs.x509_cert]]
sources = ["example.org"]
## Method for handling Server Name Indication. Can be set to "auto",
## "manual", or "disable".
##
## In "auto" mode the source hostname will be used on certificates retrieved
## over the network. When set to "manual" the contents of "server_name" will
## be sent. If set to "disable" then the server name extension will not be
## sent.
# sni = "auto"
## Server name to send when "sni" is set to "manual".
# server_name = "" |
That looks good to me, the section could be repeated for each target server name, which would be more straightforward than having a large map of URLs<->servernames in the |
Also cf.: The Prometheus blackbox exporter, which includes a
|
I've not implemented the I also can't see a documented way to do so in crypto/tls — setting The other two cases don't need the |
Might have missed something here - should the requested Actually, this might be a degenerative case of an existing problem in the tag schema for this input - successful and failing results have different tag values, so they form different series; I'd be inclined to move some of these tags into values in the plugin itself. |
How about we just add a
Are you referring to the |
Yup, probably good. Should it be optional? Would it be sensible to have the plugin add that by default, but allow the value to be overridden by a
Yes, but not uniquely: I'm not sure there's a use for |
One way you could override it is by adding tags like that with the |
The current configuration syntax provides no way to override the host name (or IP address) given in a
sources
entry and used for CN validation. This would be useful for testing hosts with multiple vhosts, service groups behind load balancers, and staging hosts which don't resolve from the domain name being tested.The text was updated successfully, but these errors were encountered: