Please use this template for troubleshooting questions.
My issue: debian 12 apt does not recognise the SSL certificate of the NGINX apt repo
How I encountered the problem: installing the nginx apt repo in order to try installing nginx
Solutions I’ve tried: installing ca-certificates as suggest in several support articles.
Version of NGINX or NGINX adjacent software (e.g. NGINX Gateway Fabric): nginx repo for debian bookworm
Deployment environment: kitchen for testing and Nutanix VM for use
Minimal NGINX config to reproduce your issue (preferably running on https://tech-playground.com/playgrounds/nginx for ease of debugging, and if not as a code block): *(Tip → Run nginx -T to print your entire NGINX config to your terminal.)
It never gets to where nginx is installed, so config of nginx is not relevant*
NGINX access/error log: *(Tip → You can usually find the logs in the /var/log/nginx directory.)
There are no logs, due to nginx never getting installed.
Error messages are as follows*
root@dom-nginx-proxy-debian-12:/home/vagrant# apt update
Hit:1 Index of /debian bookworm InRelease
Hit:2 Index of /debian-security bookworm-security InRelease
Hit:3 Index of /debian bookworm-updates InRelease
Ign:4 Index of /packages/debian/ bookworm InRelease
Ign:4 Index of /packages/debian/ bookworm InRelease
Ign:4 Index of /packages/debian/ bookworm InRelease
Err:4 Index of /packages/debian/ bookworm InRelease
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate v
erification. [IP: 3.125.197.172 443]
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
62 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
W: https://nginx.org/packages/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://nginx.org/packages/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://nginx.org/packages/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://nginx.org/packages/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: Failed to fetch https://nginx.org/packages/debian/dists/bookworm/InRelease Certificate verification failed: The certificate is NOT trusted. The ce
rtificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 3.125.197.172 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.