Using telegraf with plugin http , Error x509: certificate signed by unknown authority

Hello everyone!
I Use Telegraf with http plugin

[[outputs.http]]
url = "https://example.com/test/rest/login"
method = "POST"
tls_ca = "/etc/telegraf/ssl1/cert.pem"
tls_cert = "/etc/telegraf/ssl1/cert.pem"
tls_key = "/etc/telegraf/ssl1/key.pem"

but I get an error

Error writing to outputs.http: Post “https://example.com/test/rest/login”: x509: certificate signed by unknown authority

I call with the same information with CURL Command and the command works correctly

curl -v -H “Content-Type: application/json” --key /etc/telegraf/ssl1/key.pem --cert /etc/telegraf/ssl1/cert.pem -d’{“username”:“username”,“password”:“password”}’ https://example.com/test/rest/login

Also, I call the folowing command for the correctness of the certificate

openssl s_client -connect example.com:443 -CApath /etc/ssl/certs

CONNECTED Verification: OK Verify return code: 0 (ok)

please help me how to solve my problem in telegraf

Please provide your full logs and enable debug mode.

That error would generally imply that the certs you provided do not contain the information to validate the authority.