Hi.
I'm trying to monitor an API endpoint that requires certificate authentication. I have originally a .p12 certificate, and I am using the following commands to extract it to pem formats:
# Export certificate
openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys
# Export private key
openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes
# Copy cert and key to Zabbix directory
cp newfile.crt.pem /usr/share/zabbix/ssl/certs/
cp newfile.key.pem /usr/share/zabbix/ssl/keys/
On Zabbix dashboard:
HTTP authentication: none
SSL certificate file: /usr/share/zabbix/ssl/cert/newfile.crt.pem
SSL key file: /usr/share/zabbix/ssl/keys/newfile.key.pem
SSL key password: none
I am getting the following error:
Via curl it is working:
curl -I --key /usr/share/zabbix/ssl/keys/newfile.key.pem --cert /usr/share/zabbix/ssl/certs/newfile.crt.pem https://api.example.com/action/robotPing/1.0
HTTP/1.1 200 OK
Date: Wed, 15 Apr 2020 02:25:21 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/xml; charset=UTF-8
Content-Length: 901
Vary: Accept-Encoding
What am I doing wrong?
Thanks!
I'm trying to monitor an API endpoint that requires certificate authentication. I have originally a .p12 certificate, and I am using the following commands to extract it to pem formats:
# Export certificate
openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys
# Export private key
openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes
# Copy cert and key to Zabbix directory
cp newfile.crt.pem /usr/share/zabbix/ssl/certs/
cp newfile.key.pem /usr/share/zabbix/ssl/keys/
On Zabbix dashboard:
HTTP authentication: none
SSL certificate file: /usr/share/zabbix/ssl/cert/newfile.crt.pem
SSL key file: /usr/share/zabbix/ssl/keys/newfile.key.pem
SSL key password: none
I am getting the following error:
Code:
6161:20200415:120852.738 cannot process step "Example API checks" of web scenario "Example API checks" on host "Zabbix server": Problem with the local SSL certificate: could not load PEM client certificate, OpenSSL error error:02001002:system library:fopen:No such file or directory, (no key found, wrong pass phrase, or wrong file format?)
curl -I --key /usr/share/zabbix/ssl/keys/newfile.key.pem --cert /usr/share/zabbix/ssl/certs/newfile.crt.pem https://api.example.com/action/robotPing/1.0
HTTP/1.1 200 OK
Date: Wed, 15 Apr 2020 02:25:21 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/xml; charset=UTF-8
Content-Length: 901
Vary: Accept-Encoding
What am I doing wrong?
Thanks!
Comment