Bobcares

x509: certificate relies on legacy Common Name field

by | Jan 20, 2025

Learn how to fix “x509: certificate relies on legacy Common Name field, use SANs instead” error. Our Docker Support team is here to help you with your questions and concerns.

“x509: certificate relies on legacy Common Name field, use SANs instead” Error

"x509: certificate relies on legacy Common Name field, use SANs instead" ErrorHave you encountered the following error message in SSL/TLS communications?

x509: certificate relies on legacy Common Name field, use SANs instead

This indicates that Docker cannot validate the certificate due to the absence of SANs.

This error occurs when Docker or other software encounters a certificate using the deprecated Common Name (CN) field for server identification, instead of the modern and secure Subject Alternative Names (SANs).

SSL/TLS certificates are essential for secure communications over the internet.

  • x509 Certificate:

    A standard format for public key infrastructure (PKI) used in SSL/TLS. It includes details about the server’s identity, public key, and the issuing Certificate Authority (CA).

  • Common Name (CN):

    Historically, the CN field was used to specify the server’s fully qualified domain name (FQDN), such as `www.example.com`.

  • Subject Alternative Name (SAN):

    SAN is an extension to the x509 specification that supports multiple domain names or IP addresses in a certificate, making it the modern standard for domain identification.

Why the Common Name Field Is Deprecated

Over time, the Common Name field has been deprecated for the following reasons:

  • The CN field lacks the flexibility and security needed for robust server identity validation.
  • Unlike CN, SAN allows specifying multiple domains (e.g., `example.com` and `www.example.com`) or IP addresses in a single certificate.

As a result, modern SSL/TLS implementations, including those in Docker, enforce using SANs for domain validation. Certificates relying solely on CN may trigger compatibility issues.

Why the Error Occurs in Docker?

This error is commonly seen in Docker environments when:

  • A certificate uses only the deprecated Common Name field to identify the server.
  • Docker, or its underlying SSL library, requires certificates to include SANs for proper validation.

How to Fix the Issue

To resolve the error, ensure the SSL/TLS certificates include the SAN extension. Here’s how:

  1. First, generate a new certificate with SANs. We can use tools like OpenSSL to include SANs in our certificate configuration.
  2. Use a Certificate Authority that supports SANs. Most modern CAs, including Let’s Encrypt, automatically include SANs in issued certificates.
  3. Then, regenerate Self-Signed Certificates. If we use self-signed certificates, we can regenerate them with SANs to meet modern standards.
  4. After generating or updating the certificate, confirm it includes SANs using OpenSSL:

    openssl x509 -in mydomain.crt -text -noout

    Look for the X509v3 Subject Alternative Name section in the output.

  5. Next, ensure Docker uses the updated certificate by placing it in the appropriate directory. Finally, restart Docker to apply the changes.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

The “x509 certificate relies on legacy Common Name field” error highlights the importance of modern SSL/TLS practices. By ensuring our certificates include SANs, we can avoid compatibility issues and maintain secure communications in Docker and other environments.

In brief, our Support Experts demonstrated how to fix the “x509: certificate relies on legacy Common Name field, use SANs instead” error.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF