3 Best Solutions for Server Certificate Does Not Include an ID Which Matches the Server Name Error

Server Certificate Does Not Include an ID Which Matches the Server Name
Server Certificate Does Not Include an ID Which Matches the Server Name

DISCLOSURE: This post may contain affiliate links, meaning when you click the links and make a purchase, we receive a commission.

As a hosting provider, using a Webserver software like Apache is essential for managing your website. Although the software may be running properly, you may still be facing strange error messages popping up on your screen. Here, one such error is the message: “server certificate does not include an ID which matches the server name”.

Depending on the cause of the error and the specific circumstances, it may be possible to ignore the error safely. However, this is usually not recommended because it reduces the connection’s security and could leave you vulnerable to attacks or other security risks.

Don’t despair, though, as this article explains the error’s cause and the best troubleshooting techniques for it!

What Does The “Server Certificate Does Not Include An ID Which Matches The Server Name” Error Mean

The Server Certificate error typically occurs when you are attempting to establish a secure connection to a server, such as when accessing a website over HTTPS or connecting to a server using a secure protocol such as SSL/TLS or SSH.

There are several contributing factors that can lead to the appearance of this error message, including issues with the configuration file or the server’s certificate. These factors may be directly or indirectly related to the error prompt.

Laptop computer showing unknown error warning

Ignoring this error would limit your ability to establish a secure connection to the server. This could prevent you from accessing certain websites or services or may even stop you from using certain features or functions that rely on a secure connection.

Reasons For The “Server Certificate Does Not Include An ID Which Matches The Server Name” Error

To fix the Server Certificate error, it is important to carefully consider all possible causes in order to troubleshoot and resolve the issue effectively. Below, we have mentioned some of the potential reasons for this error so you can start troubleshooting:

Issues With The Configuration File

The configuration file for the Webserver is very important because it controls how the server should respond to different types of requests, which files it should serve, and how it should handle errors. Here, some incorrect settings may lead to the Server Certificate error prompt.

  • Entering The Configuration File

To proofread the configuration file, you should first know where it is located. The Apache Webserver’s main configuration file is usually called “httpd.conf” or “apache2.conf” and is usually located in the “/etc/httpd/” or “/etc/apache2/” directories. You can refer to Apache’s page for a complete list of default installation layouts for Apache HTTPD on various OS and distributions.

Additionally, the SSL certificate configuration may be located in a different file, such as a file called “https-ssl.conf” or in a <VirtualHost> block in a directory like “/etc/https/vhosts.d/” or “/etc/https/sites/.

Configuration Settings Setup Tools

You can use the following grep command on Linux to search SSL Configuration in the “/etc/httpd/” directory, which is the base directory for Apache installation:  grep -i -r “SSLCertificateFile” /etc/httpd/

Now that you’ve found your way to the configuration file, let’s discuss the settings which assist in prompting the error message:

  • Missing Port 443

It is possible that your Webserver is only set up to listen to port 80 and is not configured to listen to port 443. This means that port 443, which is the default port for HTTPS communication, is not included in the Webserver’s configuration file.

This causes issues if you are trying to access your website or web application over a secure connection, as the server will not be able to establish an HTTPS connection without proper configuration.

  • Incorrect ServerName

Blue BSOD Error At Computer

The error can also be prompted if the Apache HTTPD cannot match the ServerName to the common name or any of the subjectAlternateName fields in the certificate. This occurs if the certificate was issued for a domain name that does not match the ServerName specified in the Webserver’s configuration file.

  • Disabled SSL Engine

Although this is not a direct cause, if your SslEngine setting is switched OFF for unknown reasons, you may likely get the Server Certificate prompt that stops you from securely developing a connection with the server.

Issues With The Server’s Certificate

If you have been using self-signed certificates that have reached their expiration date, it is possible that you may encounter the Server Certificate error message. This message is also a notification that the certificate is no longer valid and may not be trusted by certain systems or applications for use.

Best Techniques for Troubleshooting the “Server Certificate Does Not Include an ID Which Matches the Server Name” Error

If you know the root cause of the error, it should be relatively easier to fix it. However, it can be confusing to solve the problem, even for veterans in the domain of web hosting. Therefore, we have included some troubleshooting methods to help you fix the Server Certificate issue quickly:

Solution 1: Resolving Configuration File’s Issues

To solve the configuration file’s issues, you must modify it accordingly. There are different solutions for each configuration file error, which are listed as follows:

  • Adding Port 443

If your configuration file was not listening to port 443, that is, it was listening to port 80 only, you need to include port 443 to ensure that your server is set up to listen to this port too.

Listening to Port 80 only allows your website access over non-secure (HTTP) connections. However, with the addition of Port 443, your website would be accessible over secure (HTTPS) connections as well. For this procedure, though, you may need to set up a virtual host for the new type of connection.

One way to set up a new virtual host is to create a copy of your existing non-secure virtual host and then configure it to use SSL. The new virtual host for port 443 should be set up in the following format:

<VirtualHost *:443>


SSH remote port 443


  • Correcting ServerName

It is important to correctly configure the ServerName to avoid issues with the operations of the Webserver. There are two ways to do this, which are listed:

  • Switching Directives

Simply swapping the ServerName and ServerAlias directives can help eliminate this error.

<VirtualHost *:443>
ServerName www.example.com
ServerAlias example.com


This is a possible solution if your certificate is for “www.example.com” and not for “example.com”.

  • LocalHost

You can try changing the ServerName to localhost in your Webserver’s configuration to resolve this issue. You’d also need to comment out the previous ServerName line (by using # at the line’s start) and write the following line below it: ServerName localhost. You can refer to this detailed guide regarding this fix.

Command line interface terminal lines

  • Enabling SSL Engine

To enable the SslEngine, simply toggle the setting from OFF state to ON one, that is, SslEngine ON

This action will indirectly stop the error message from prompting in the log file. In addition, it will also ensure the security and privacy of data transmitted over the internet and provide a better user experience.

Solution 2: Creating New Certificates

It is important to regularly check the expiration dates of any certificates you are using and to renew or replace them as necessary to avoid the Server Certificate error and ensure the security of your data and systems.

  • Generating The Certificates

You can generate the new SSL certificate in the following steps:

  1. Extract the location of the certificate key file using the following command: cat /etc/apache2/sites-available/default-ssl.conf | grep SSLCertificate

Hint: Look for two lines (marked File and KeyFile).

  1. If you are obtaining the SSL/TLS certificates from a professional certificate authority (CA), you should follow the instructions from your licensing organization to obtain and use the certificates correctly. Otherwise, you can use the following command: sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout KeyFile -out File

Note: Don’t forget to replace the KeyFile and File with the text that you obtained from Step 1. These locations serve as input and output for these certificates.

Unhappy young woman sit at home work on laptop

Provided the issue was caused due to outdated certificates, updating them should be sufficient to resolve this error. You can further read this guide to learn more about the certificates you have currently installed to assist you in the troubleshooting process.


  • Adjusting The Files

After the certificates are regenerated, you must ensure that they are adjusted to match your certificate files in the configuration file of Apache in the following format:

<VirtualHost *:443>

SSLCertificateFile /path/to/your_domain_name.crt
SSLCertificateKeyFile /path/to/your_private.key
SSLCertificateChain /path/to/XYZ.crt


  • SSLCertificateFile: This is your certificate file.
  • SSLCertificateKeyFile: This is the key file generated when you created the CSR (Certificate Signing Request).
  • SSLCertificateChainFile: This is the intermediate certificate file. You can use the SSLCACertificateFile directive instead if the SSLCertificateChainFile directive doesn’t work for you.

After your certificate files are correctly matched, it is expected that this error may stop appearing, assuming the root cause of the prompt was the problem with the certificates.

Solution 3: Restarting Your Webserver

Restart design of program menu

If you continue to receive the error warning after verifying that your certificates are valid and up to date, it may be helpful to restart your Webserver as a final troubleshooting step.

  • Syntax Verification

It is generally a good idea to check the syntax of your Webserver’s configuration files before restarting it to ensure that no syntax error could cause the server to fail to start or function properly. You can check for correct syntax using the following command: sudo apache2ctl configtest

You can confirm that your syntax is correct by expecting the following output from the above command: Syntax OK

  • Rebooting Webserver

After verifying the syntax, it is time to use the following systemctl command to restart the Apache server: sudo systemctl restart apache2


SEO Online Website Web Hosting Technology

We hope that you were able to resolve the Server Certificate error prompt using our guide. You can confirm that this error is fixed by skimming through the “error.log” file, which is usually located in the “/var/log/apache2” directory.

For more Webhosting guides and tips, be sure to check out our blog to learn all the intricate details about softwares and web hosting!