You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Telegraf 1.13.0 (git: HEAD 773e4ca)
Ubuntu 18.04 64-bit (Azure VM)
Steps to reproduce:
Create a file with a normal certificate, a CA certificate and a private key concatenated in that order.
Set it up as a monitored file as mentioned above.
Expected behavior:
Expect to get metrics for both the primary certificate and the CA certificate, and the private key should be ignored.
Actual behavior:
No metrics are emitted, and this error is shown in the log:
2020-01-07T13:02:40Z E! [inputs.x509_cert] Error in plugin: cannot get SSL cert '/etc/pki/public.pem': asn1: structure error: tags don't match (16 vs {class:0 tag:2 length:1 isCompound:false}) {optional:false explicit:false application:false private:false defaultValue: tag: stringType:0 timeType:0 set:false omitEmpty:false} tbsCertificate @2
Additional info:
My guess is that the x509.ParseCertificate() function is triggering an error when the private key is encountered and all the certificates found in the file so far are discarded.
Metrics for the public.crt file are emitted, as that file contains no private key (but has multiple certificates).
In earlier versions of telegraf (tested 1.12.x) the metrics for the first certificate of the file was emitted, even if the file contained a private key. This commit seems to be involved: c53d538
The text was updated successfully, but these errors were encountered:
If a file with both certificates and private keys is monitored by x509_cert input, no metrics are emitted for that file.
Relevant telegraf.conf:
System info:
Telegraf 1.13.0 (git: HEAD 773e4ca)
Ubuntu 18.04 64-bit (Azure VM)
Steps to reproduce:
Expected behavior:
Expect to get metrics for both the primary certificate and the CA certificate, and the private key should be ignored.
Actual behavior:
No metrics are emitted, and this error is shown in the log:
2020-01-07T13:02:40Z E! [inputs.x509_cert] Error in plugin: cannot get SSL cert '/etc/pki/public.pem': asn1: structure error: tags don't match (16 vs {class:0 tag:2 length:1 isCompound:false}) {optional:false explicit:false application:false private:false defaultValue: tag: stringType:0 timeType:0 set:false omitEmpty:false} tbsCertificate @2
Additional info:
My guess is that the x509.ParseCertificate() function is triggering an error when the private key is encountered and all the certificates found in the file so far are discarded.
Metrics for the public.crt file are emitted, as that file contains no private key (but has multiple certificates).
In earlier versions of telegraf (tested 1.12.x) the metrics for the first certificate of the file was emitted, even if the file contained a private key. This commit seems to be involved: c53d538
The text was updated successfully, but these errors were encountered: