Why this matters for PCI DSS
PCI DSS 4.0 Requirement 4.2.1 requires "trusted keys and certificates" on any system that transmits cardholder data over open networks. An expired, mismatched, or self-signed certificate fails this requirement outright.
Beyond the spec: a broken certificate triggers browser warnings that train customers to ignore security indicators, increasing the practical risk of a successful man-in-the-middle attack. A weak key (RSA-1024, MD5 signature) is potentially forgeable today.
How to fix it
Free, automated, recommended — use Let's Encrypt via certbot. It handles issue, install, and 90-day renewal automatically:
sudo certbot --nginx -d example.com -d www.example.com
# or for Apache:
sudo certbot --apache -d example.com -d www.example.com
Renewal runs from a systemd timer or cron — verify with sudo certbot renew --dry-run.
Windows / IIS — install win-acme, run wacs.exe, pick your IIS site from the menu. It auto-installs the cert and creates a scheduled task for renewal.
Hostname mismatch — reissue the cert with every hostname your site answers on, listed as SANs. If you serve example.com and www.example.com, both must be in the certificate.
Verify your fix:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -dates -subject -issuer
For a deep audit, run a full scan at SSL Labs — aim for an A or A+ grade.