Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

httpd not starting after installing certificate [closed]

i got a ssl cert and im running ubuntu

the domain.crt and domain.ca-bundle files and in the folder as specified but no matter what i keep getting these errors

[Sat Jul 27 06:35:00 2013] [error] Unable to configure verify locations for client authentication
[Sat Jul 27 06:35:00 2013] [error] SSL Library Error: 218570875 error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long
[Sat Jul 27 06:36:55 2013] [error] Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] (/etc/apache2/sites-enabled/default-ssl:2)

my port.conf is

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
NameVirtualHost *:443
    Listen 443
</IfModule>

and my default-ssl is as follows

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName www.domain.com
        ServerAlias domain.com
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
                           -----------
                        ---------------
 -------------------- more configs



#   SSL Engine Switch:
        #   Enable/Disable SSL for this virtual host.
        SSLEngine on

        #   A self-signed (snakeoil) certificate can be created by installing
        #   the ssl-cert package. See
        #   /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
        #   If both key and certificate are stored in the same file, only the
        #   SSLCertificateFile directive is needed.
        #   SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateFile  /etc/ssl/private/domain.crt
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
        SSLCertificateChainFile /etc/ssl/private/domain.ca-bundle
like image 1000
mega-crazy Avatar asked Jul 27 '13 13:07

mega-crazy


People also ask

Do I need to restart Apache after changing certificate?

For Apache to use your newly installed certificate, you will need to restart Apache. Normally this can be done with apachectl restart, /etc/init. d/httpd restart, or /etc/init. d/apache restart.

Do I need to restart after installing certificates?

You would only need to restart the Server if you manually generate the SSL certificate due to exception conditions such as changes in hostname or host IP in your etc/hosts.


2 Answers

Solution

I added these in /etc/apache2/apache2.conf

SSLCertificateFile your.crt
SSLCertificateKeyFile your.key
SSLCertificateChainFile your_bundle.crt

 Long part

There was some message when I enabled ssh in apache to read file /usr/share/doc/apache2.2-common/README.Debian.gz, it says:

6) Message "Server should be SSL-aware but has no certificate configured" in
   error log

Since 2.2.12, Apache is stricter about certain misconfigurations concerning
name based SSL virtual hosts. See NEWS.Debian.gz for more details.

And NEWS says:

  * The new support for TLS Server Name Indication added in 2.2.12 causes
    Apache to be stricter about certain misconfigurations involving name
    based SSL virtual hosts. This may result in Apache refusing to start
    with the logged error message:

        Server should be SSL-aware but has no certificate configured
        [Hint: SSLCertificateFile]

    Up to 2.2.11, Apache accepted configurations where the necessary SSL
    configuration statements were included in the first (default)
    <Virtualhost *:443> block but not in subsequent <Virtualhost *:443>
    blocks. Starting with 2.2.12, every VirtualHost block used with SSL must
    contain the SSLEngine, SSLCertificateFile, and SSLCertificateKeyFile
    directives (SSLCertificateKeyFile is optional in some cases).

    When you encounter the above problem, the output of the command

        egrep -ir '^[^#]*(sslcertificate|sslengine|virtualhost)' \
            /etc/apache2/*conf* /etc/apache2/*enabled

    may be useful to determine which VirtualHost sections need to be changed.

There is more there.

like image 67
sites Avatar answered Oct 21 '22 04:10

sites


You can try these for SSL certificate integration. This should be under httpd.conf file under virtual host and please locate the virtual host section for the site that the SSL certificate will secure.

SSLCACertificateFile - This will need to point to the appropriate to root CA certificate.

SSLCertificateChainFile - This will need to point to the appropriate intermediate root CA certificates

SSLCertificateFile - This will need to point to the end entity certificate (the one you have called "mydomain.crt")

SSLCertificateKeyFile – This will need to point to the private key file associated with your certificate.

like image 3
The Whisperer Avatar answered Oct 21 '22 03:10

The Whisperer