[ZBX-24698] HTTP Agent does not load client certificate key Created: 2024 Jun 20  Updated: 2024 Oct 29  Resolved: 2024 Oct 29

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 7.0.0
Fix Version/s: 7.0.6rc1, 7.2.0beta1

Type: Problem report Priority: Trivial
Reporter: Ulisses Melo Assignee: Andris Mednis
Resolution: Fixed Votes: 16
Labels: None
Remaining Estimate: Not Specified
Time Spent: 12h
Original Estimate: Not Specified

Attachments: PNG File image-2024-06-20-14-12-14-485.png     PNG File image-2024-06-20-14-12-40-352.png     PNG File image-2024-06-20-14-13-25-491.png     PNG File image-2024-06-20-14-14-59-074.png     PNG File image-2024-06-20-14-16-41-110.png     PNG File image-2024-06-20-14-18-37-560.png    
Issue Links:
Duplicate
is duplicated by ZBX-24706 HTTP Agent cannot find certificate fi... Closed
Team: Team C
Sprint: S24-W42/43
Story Points: 2

 Description   

Steps to reproduce:

  1. Create a HTTP agent item.
  2. Input data on mandatory files
  3. Input certificate file name on "SSL certificate file".
  4. Input key file name on "SSL key file".
  5. Add item.
  6. Test Item.
  7. Execute Now

Result:
Expected:
Same result obtained on item test.

Certificate and key files do match:

This bug appeared after upgrade from version 6.4.14 to 7.0.0



 Comments   
Comment by Ulisses Melo [ 2024 Jun 20 ]

Error message: "Cannot perform request: could not load PEM client certificate, OpenSSL error error:80000002:system library::No such file or directory, (no key found, wrong pass phrase, or wrong file format?)"

Comment by Jacob R [ 2024 Jun 22 ]

azyla HTTP Agent checks that require a client cert are not working in 7.0.0. If this is trivial, please provide the workaround. Thanks

Comment by Martin Frey [ 2024 Jul 17 ]

The same issue also occurs when running the HTTP check from the proxy, using the zabbix-proxy-sqlite3:7.0.0-ol container image.
When running the HTTP metrics reader from the web GUI as a test, it completes without an error and returns the correct content. when the proxy runs the reader on schedule, it fails however.

As a workaround, I can replace the HTTP check by external check running curl:
curl --cacert /var/lib/zabbix/ssl/ssl_ca/etcd-ca.pem --cert /var/lib/zabbix/ssl/certs/etcd.crt --key /var/lib/zabbix/ssl/keys/etcd.key https://x.x.x.x/health

Comment by Christian Rinjes [ 2024 Jul 23 ]

With 7.0.1, the error message I see is `could not load PEM client certificate from (null)/client.crt`. It looks like maybe the `SSLCertLocation` is not properly prefixed?

Comment by Alek Robson [ 2024 Aug 08 ]

Are you planning to fix that? I don't understand why this is not fixed when we have zabbix 7.0.2 out

Comment by Lucas Hökerberg [ 2024 Aug 20 ]

I'm using the following community template to monitor Docker Swarm, and I have the same issue:

https://github.com/zabbix/community-templates/tree/main/Virtualization/Docker/template_docker_swarm_monitoring/6.0

 

Error: Cannot perform request: could not load PEM client certificate from (null)/docker.crt, OpenSSL error error:80000002:system library::No such file or directory, (no key found, wrong pass phrase, or wrong file format?)

 

I have tried to explicit configure the SSL file location in the zabbix_server.conf file without success.

Comment by Anna Pomezna [ 2024 Aug 30 ]

Hi azyla,
any update on this, please?
We are having the same issue in Zabbix 7.0.3

Thanks.

Comment by Jacob R [ 2024 Oct 04 ]

azyla Any updates on this? Again, please specify how this is trivial. Might as well remove any mention of "SSL" on the HTTP agent docs until this is fixed. This documented feature isn't working at all since 7.0.

Comment by Michel Desconnets [ 2024 Oct 05 ]

Hi
I update in 7.0.4 and it seems it is ok ? I only have 1 check using pem, but my data come back ....

Comment by Ulisses Melo [ 2024 Oct 05 ]

I am also at version 7.0.4 and it still doesn't work for me.

Comment by Michel Desconnets [ 2024 Oct 08 ]

Indeed. Originally, my problem was with a Zabbix-proxy 7.0.3. I recompiled a 7.0.3 myself, patching it in a VERY ugly way to make it work, and I had only replaced the binary.

During an upgrade, everything was updated to 7.0.4, and my binary was indeed replaced, as I saw the version change in my items/triggers that check the proxy.

BUT during a reboot, the error “returned”, so I put back my 7.0.3 binary.

I don’t understand how I could have had a working 7.0.4 for a while…

In any case, the error must come from a refactoring of the variables that took place. My “ugly” patch “for the proxy” just reinjects the default value if it’s null “just” at the place where it’s used, but the overall code level is beyond me to detect where the problem comes from upstream…

Comment by Jacob R [ 2024 Oct 15 ]

sasha Can you perhaps weigh-in on this? If this is "trivial", what is the workaround to get it working in any way?

Comment by Alexander Vladishev [ 2024 Oct 16 ]

Thank you for pointing out this ticket. Our development team will check this issue.

Comment by Andris Mednis [ 2024 Oct 16 ]

Cannot reproduce with 7.0.1 and current release/7.0.

Do you have in zabbix_server.conf file parameters SSLCertLocation and SSLKeyLocation set, for example:

SSLCertLocation=/home/zabbix/certs 
SSLKeyLocation=/home/zabbix/certs

Is certificate in PEM format? You can check it like

openssl x509 -in your_certificate_file.pem  -text -noout
Comment by Jacob R [ 2024 Oct 16 ]

Yes, I have those set. Also, note that the item will appear to work via the web interface "execute now", but fails when the item actually executes via its set interval.

Comment by Andris Mednis [ 2024 Oct 16 ]

Thanks, JacobR!

Also, note that the item will appear to work via the web interface "execute now", but fails when the item actually executes via its set interval.

was helpful to reproduce.

Comment by Andris Mednis [ 2024 Oct 24 ]

Available in versions:

Generated at Tue Apr 29 08:32:20 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.