telegraf: x509 Certificate Input Plugin v1.19.0 does not work with URL

Relevant telegraf.conf:

[[inputs.x509_cert]]
sources = ["https://my.server.com:443"] 

System info:

Windows Server 2019 Telegraf v1.19.0

Steps to reproduce:

  1. Configure inputs.x509_cert
  2. telegraf.exe --config “C:\Program Files\Telegraf\telegraf.conf” --test --input-filter x509_cert --debug

Expected behavior:

Certificate details returned

x509_cert,common_name=*.server.com,country=GB <snip> x509_cert,common_name=Root Cert <snip>

Actual behavior:

No certificate details are returned 2021-06-16T16:52:07Z E! [inputs.x509_cert] could not find file: &{https:\my.server.com:443 false false <nil>}

Additional info:

Telegraf v1.18.1 on the same system does not show this issue.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

I just had a look at the x509_cert documentation. It is a little bit inconsistent, the example config uses “tcp://example.org:443” but the sample output has “source=https://example.org:443”. So this is the reverse behaviour from what we are seeing now with 1.19, and it is still crazy for me. I would expect “tcp://” in and “tcp:😕/” out, or “https://” in and “https://” out.

I got your point now… before telegraf 1.18 it was source=https://www.xxx.com:443 and with telegraf 1.19 it is now source=tcp://www.xxx.com:443 So we still have a little problem here.