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

Fix schema mess-up for x509 with https #9400

Merged
merged 1 commit into from Jun 22, 2021

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Jun 18, 2021

Required for all PRs:

  • Updated associated README.md.
  • Wrote appropriate unit tests.

When using the x509_cert plugin with https sources, the source tag should contain the specified source. However, in #6952 we messed up that tag by unintentionally changing the scheme of the source to tcp for https sources as described in #9384. The present PR fixes this issue by not messing with the scheme directly.

Please note: This PR is based on and should be merged after #9289!

resolves #9384

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Jun 18, 2021
@popey
Copy link
Contributor

popey commented Jun 21, 2021

Tested in Linux, using:

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

Worked as expected.

1 alan@ac:~/Apps/telegraf/telegraf-1.19.0$ /tmp/telegraf-1.19.0/usr/bin/telegraf --debug --test --config ./etc/telegraf/telegraf.conf 
2021-06-21T13:59:37Z I! Starting Telegraf 
2021-06-21T13:59:37Z D! [agent] Initializing plugins
2021-06-21T13:59:37Z D! [agent] Starting service inputs
2021-06-21T13:59:37Z D! [agent] Stopping service inputs
2021-06-21T13:59:37Z D! [agent] Input channel closed
2021-06-21T13:59:37Z D! [agent] Stopped Successfully
> x509_cert,common_name=popey.com,host=ac,issuer_common_name=R3,public_key_algorithm=RSA,san=popey.com,serial_number=475269a602750dccbf81f0efd750705d774,signature_algorithm=SHA256-RSA,source=https://popey.com:443,verification=valid age=5026146i,enddate=1627033831i,expiry=2749853i,startdate=1619257831i,verification_code=0i 1624283977000000000
> x509_cert,common_name=R3,country=US,host=ac,issuer_common_name=DST\ Root\ CA\ X3,organization=Let's\ Encrypt,public_key_algorithm=RSA,serial_number=400175048314a4c8218c84a90c16cddf,signature_algorithm=SHA256-RSA,source=https://popey.com:443,verification=valid age=22185477i,enddate=1632943300i,expiry=8659322i,startdate=1602098500i,verification_code=0i 1624283977000000000

@sspaink sspaink merged commit d63a701 into influxdata:master Jun 22, 2021
reimda pushed a commit that referenced this pull request Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x509 Certificate Input Plugin v1.19.0 does not work with URL
3 participants