-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[[inputs.x509_cert]] not working with filepath on windows #10580
Comments
same bug for me |
This could be PR9289(#9289) related. |
On 1.19.0 and 1.21.3 If I try
on 1.19.0 and later i get None of the paths above works with wildcards. If i replace the mycertfile0 with * I get the following errors: |
I took a look at this and looks like there are few issues with windows paths(file:// uris).
Using With I'm not sure if network shares are supported (https://github.com/influxdata/telegraf/blob/master/plugins/inputs/x509_cert/x509_cert.go#L268) uses just url Path for I can think of few changes:
@srebhan do you have time to take a look if this looks reasonable ? |
Would you be willing to put up a PR? I think we would be happy to review something that improves this situation on Windows. |
@davidaugustin1 and @aarnaud can you please test the binary built by CI in #12629!?! Windows paths can now be sources = [
'file://C:\Windows\Temp\test.pem',
"file://C:\\Windows\\Temp\\test.pem",
"/Windows/Temp/test.pem",
"file://C:/Windows/Temp/test.pem"
] Please not the single-quotes for the first entry to avoid the need to escape the backslashes... Let me know if this fixes your issue! |
I pretty sure it's fixed, but let me come back to confirm. |
I'm not sure if @aarnaud can you also test if some of these work:
|
@jjh74 so do you think we should not support |
The PR is updated to handle both cases. @aarnaud if you can test and report back quickly we might be able to include this in v1.25.2 (due on Monday IIRC)... ;-) |
Sorry for delay, I needed time to test on windows...
Ready for 1.25.2 |
Relevent telegraf.conf
Logs from Telegraf
System info
Telegraf 1.21.3, Telegraf 1.18.3, Windows 10
Docker
No response
Steps to reproduce
...
Expected behavior
Check the certificate file and give an output
Actual behavior
Error: Couldn't parse/find the certificate file
Additional info
I've tested multiple ways to enter the filepath on windows.
See below for some of them I used in the config (didn't log everyone). I have grouped them by the error they show.
Some of the entries worked under 1.18.3, others are completely rubish but maybe they can help.
I know that Windows drive letters aren't possible with this Plugin at the moment. I've tested them anyway to see if i can find a workaround. The first tree entries shouldn't work, but telegraf finds the certificate and checks it, but missreads the drive letter as host. This however doesn't work with wildcards
The text was updated successfully, but these errors were encountered: