11

I have a problem installing the SSL certificates. The problem i think the server name doesn't match the certificate's server name.

Here the exact Apache problem:

[Wed Oct 02 18:33:23 2013] [warn] RSA server certificate CommonName (CN) `name1.name2.fr' does NOT match server name!?
[Wed Oct 02 18:33:23 2013] [error] Unable to configure RSA server private key
[Wed Oct 02 18:33:23 2013] [error] SSL Library Error: 185073780 error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch
[Wed Oct 02 18:34:00 2013] [warn] RSA server certificate CommonName (CN) `name1.name2.fr' does NOT match server name!?
[Wed Oct 02 18:34:00 2013] [error] Unable to configure RSA server private key
[Wed Oct 02 18:34:00 2013] [error] SSL Library Error: 185073780 error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch 

We use RHEL 6. How can i see the server name and how to change it ?

Thanks in advance.

Jorge Vega Sánchez
  • 7,430
  • 14
  • 55
  • 77
  • Also see [Assigning a domain name to localhost for development environment](https://stackoverflow.com/q/7576217/608639) and [Third-Party Signed SSL Certificate for localhost or 127.0.0.1?](https://stackoverflow.com/q/6793174/608639) – jww Mar 04 '18 at 16:46

2 Answers2

12

You have to set the Server's DNS name first:

so perform the command
$ sudo gksu gedit  /etc/hostname  to edit the hostname file
add the line www.example.com

$ sudo  /etc/hosts and add the line:
127.0.0.1   www.example.com localhost

After that make sure to use that domain name in creating or signing the certificate

jww
  • 97,681
  • 90
  • 411
  • 885
drabo2005
  • 1,076
  • 1
  • 10
  • 16
9

I had this warning in ssl_error_log:

[Wed Dec 11 14:02:41 2013] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Dec 11 14:02:41 2013] [warn] RSA server certificate CommonName (CN) `localhost.localdomain' does NOT match server name!?

It is because that mod_ssl in CentOS (5.10) came with a default virtualhost which will use the default cert in /etc/pki/tls/certs/localhost.crt....

I removed the virtualhost section in conf.d/ssl.conf and the warning disappeared after reloading apache.

Jedwin
  • 101
  • 1
  • 2
  • This fixed worked for me. Note that I kept all of the other settings in ssl.conf (turning on SSL engine and what not) and just deleted the default virtual host that was in the file. – Michael J Feb 11 '16 at 01:01