title: SSL Certificate error in Apache 2.4 ending to gitlab domain.com/users/sign_in
body: <p>I am facing a problem of certificate SSL.</p>
  <p>I have a dedicated host, and I cannot get what I am missing to receive the error by navigator:
  Chrome:</p>
  <blockquote>
  <p>NET::ERR_CERT_COMMON_NAME_INVALID</p>
  </blockquote>
  <p>Mozilla:</p>
  <blockquote>
  <p>SSL_ERROR_BAD_CERT_DOMAIN</p>
  </blockquote>
  <p>Messages in browser are quite similar:</p>
  <blockquote>
  <p>Impossible to verify from server that it is truly domain: site2.com, because its certif of security come from *.sub.site1.com. It may come from a bad config or connection getting catch by pirate. (translated message)</p>
  </blockquote>
  <p>So it seems that the certificate is not taken while it goes threw vitrual box:</p>
  <pre><code>&lt;VirtualHost *:80&gt;
    ServerName www.site2.com
    ServerAlias site2.com
  
    Redirect permanent / https://site2.com/
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:443&gt;
    ServerName www.site2.com
    ServerAlias site2.com
    DocumentRoot /var/www/site2
  
    Protocols h2 http:/1.1
  
    &lt;If &quot;%{HTTP_HOST} == 'www.site2.com'&quot;&gt;
      Redirect permanent / https://site2.com/
    &lt;/If&gt;
  
    ErrorLog ${APACHE_LOG_DIR}/site2-error.log
    CustomLog ${APACHE_LOG_DIR}/site2-access.log combined
  
    SSLEngine On
    SSLCertificateFile /home/certifs/site2.crt
    SSLCertificateKeyFile /home/certifs/site2.key
    SSLCertificateChainFile /home/certifs/site2.pem
  
    SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
    SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
    SSLCompression off
    SSLUseStapling on
  
    &lt;Directory /var/www/site2/&gt;
         Options FollowSymlinks
         AllowOverride All
         Require all granted
    &lt;/Directory&gt;
  
    &lt;Directory /var/www/site2/&gt;
         RewriteEngine on
         RewriteBase /
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteRule ^(.*) index.php [PT,L]
    &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  
  </code></pre>
  <p>FInaly, if I choose to go anyway to the website it is arriving to a sign in gitlab page like:</p>
  <blockquote>
  <p>site2.com/users/sign_in</p>
  </blockquote>
  <p>For information server works with apache2 and debian, and we have gitlab install.</p>
  <p>Thank you in advance for your help.</p>