1

I am getting a "Unable to connect" error message when I try to load the https version of a website in Firefox.

There is no error message in the log file, only:

[Thu Dec 09 16:55:24 2010] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Dec 09 16:55:25 2010] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 09 16:55:25 2010] [notice] Digest: done
[Thu Dec 09 16:55:26 2010] [notice] Apache/2.2.16 (FreeBSD) mod_ssl/2.2.16 OpenSSL/0.9.8n DAV/2 PHP/5.3.3 with Suhosin-Patch configured -- resuming normal operations

I followed this guide: http://www.akadia.com/services/ssh_test_certificate.html

My configuration file looks like this:

<Directory "/usr/local/www/apache22/data">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
</Directory>

NameVirtualHost *:443
<VirtualHost *:443>
    DocumentRoot "/usr/local/www/apache22/data"

    ServerName "domain.name"

    SSLEngine on
    SSLCertificateFile /some-folder/ssl-key/server.crt
    SSLCertificateKeyFile /some-folder/ssl-key/server.key

    CustomLog "/some-folder/log/httpd-ssl_request.log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot "/usr/local/www/apache22/data"

    ServerName "domain.name"
</VirtualHost>

(Redacted a small amount, but you should be able to see what I've done right/wrong...)

olive
  • 145
  • 2
  • 8
  • Cross-posted from here on GregS' advice: http://stackoverflow.com/questions/4401452/cant-get-self-signed-ssl-certificate-to-work – olive Dec 10 '10 at 11:11

1 Answers1

2

Apache doesn't listen on port 443 (the port used for SSL communication) by default (to my knowledge). So, in order to be able to connect to to your newly configured SSL server, you need to include the following line in the configuration:

Listen 443

Configuring a virtual host doesn't automatically makes the server listen on the port specified in the configuration.

Lacek
  • 7,233
  • 24
  • 28