0

I am unable to use https on my localhost testmachine. I cant figure out the problem on my own so here is what i did:

I placed the following to files in sites-available : 000-default.conf

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug

CustomLog ${APACHE_LOG_DIR}/access.log combined

default-ssl.conf

[default-ssl.conf Pastebin Link][1]

cd /etc/apache2/mods-enabled

sudo ln -s ../mods-available/rewrite.load rewrite.load

sudo /etc/init.d/apache2 restart

a2ensite default-ssl

However when trying to use https i revice

Error code: ERR_CONNECTION_REFUSED

ports.conf:

Listen 80
<IfModule ssl_module>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

Using openssl s_client -connect localhost:443 </dev/null Gives me:

connect: Connection refused connect:errno=111 So APache is not listenning on 443, but it should be based on the ports.conf?

An suggestions? Let me know if you need more informations.

UPDATE:

    [Mon Mar 09 12:01:55.092346 2015] [ssl:info] [pid 7091] AH02200: Loading certificate & private key of SSL-aware server '127.0.1.1:443'
[Mon Mar 09 12:01:55.092520 2015] [ssl:debug] [pid 7091] ssl_engine_pphrase.c(506): AH02249: unencrypted RSA private key - pass phrase not required
[Mon Mar 09 12:01:55.092532 2015] [ssl:debug] [pid 7091] ssl_engine_pphrase.c(181): AH02199: SSL not enabled on vhost 127.0.1.1:80, skipping SSL setup
[Mon Mar 09 12:01:55.092546 2015] [ssl:info] [pid 7091] AH01914: Configuring server 127.0.1.1:443 for SSL protocol
[Mon Mar 09 12:01:55.092658 2015] [ssl:debug] [pid 7091] ssl_engine_init.c(328): AH01893: Configuring TLS extension handling
[Mon Mar 09 12:01:55.092661 2015] [ssl:debug] [pid 7091] ssl_engine_init.c(836): AH02232: Configuring RSA server certificate
[Mon Mar 09 12:01:55.092705 2015] [ssl:warn] [pid 7091] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Mar 09 12:01:55.092731 2015] [ssl:debug] [pid 7091] ssl_util_ssl.c(407): AH02412: [127.0.1.1:443] Cert does not match for name '127.0.1.1' [subject: emailAddress=asd,CN=asd,OU=asd,O=asd,L=ads,ST=asd,C=DE / issuer: emailAddress=asd,C$
[Mon Mar 09 12:01:55.092734 2015] [ssl:warn] [pid 7091] AH01909: RSA certificate configured for 127.0.1.1:443 does NOT include an ID which matches the server name
[Mon Mar 09 12:01:55.092736 2015] [ssl:debug] [pid 7091] ssl_engine_init.c(891): AH02236: Configuring RSA server private key
  • Did you look at the error log of the server? And since IfModule will ignore the lines if the module is not installed - are you sure you either have ssl_module or mod_gnutls installed? – Steffen Ullrich Mar 9 '15 at 10:52
  • @SteffenUllrich i switched all Logging to Debug but there is non created when trying to access a site – Shaeldon Mar 9 '15 at 10:54
  • You need to create a certificate. Have you done that? – Faheem Mitha Mar 9 '15 at 10:56
  • @SteffenUllrich i updated the post. – Shaeldon Mar 9 '15 at 11:08
  • @FaheemMitha i did. – Shaeldon Mar 9 '15 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.