SSL/TLS: Server Certificate Is Not Trusted
What is an untrusted SSL/TLS certificate?
Why is an untrusted SSL/TLS certificate a security risk?
How to configure a trusted SSL certificate?
To address this issue, configure a trusted SSL/TLS certificate for the web server. Obtain the certificate from a reputable Certificate Authority and ensure proper installation. Consult specific guides for configuration:
How to detect an untrusted SSL/TLS certificate?
An untrusted SSL/TLS certificate can be detected through several methods, such as browser warnings, command-line tools, and automated scanning tools.
import ssl
import socket
from datetime import datetime
hostname = ''
port = 443
context = ssl.create_default_context()
with socket.create_connection((hostname, port)) as sock:
with context.wrap_socket(sock, server_hostname=hostname) as ssock:
cert = ssock.getpeercert()
print('Certificate Issuer:', cert.get('issuer'))
print('Valid From:', cert.get('notBefore'))
print('Valid To:', cert.get('notAfter'))
# Check expiration
expiration_date = datetime.strptime(cert.get('notAfter'), '%b %d %H:%M:%S %Y %Z')
if expiration_date < datetime.now():
print('Warning: Certificate has expired!')
else:
print('Certificate is valid.')
This Python snippet connects to a server using SSL/TLS, retrieves its certificate, and checks its validity, including expiration status.
openssl s_client -connect :443
This command retrieves the server's SSL/TLS certificate details, including its issuer and expiration date. It can help identify if the certificate is untrusted or misconfigured.
Note: These scripts are for educational purposes only. Always ensure you have permission before scanning or testing websites you don't own or operate.
Vulnissimo scored the severity risk of this vulnerability to 65 out of 100. This means that it requires immediate attention.
Vulnissimo tests for SSL/TLS: Server Certificate Is Not Trusted and many more. Sharpen your security posture with our advanced web vulnerability scanner.