Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I created a staging site with a self signed certificate using:

mkdir /etc/ssl/wildcard.yourdomain.com
cd /etc/ssl/wildcard.yourdomain.com/
openssl genrsa 2048 > host.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert

openssl x509 -noout -fingerprint -text < host.cert > host.info
cat host.cert host.key > host.pem
chmod 400 host.key host.pem

sudo a2enmod ssl
sudo service apache2 restart

<VirtualHost *:443>

SSLEngine On
SSLCertificateFile /etc/ssl/wildcard.yourdomain.com/host.pem
SSLCertificateKeyFile /etc/ssl/wildcard.yourdomain.com/host.key

(from http://blog.justin.kelly.org.au/how-to-create-self-signed-wildcard-ssl-certificates-for-apache/)

The issue I"m having is that *.yourdomain.com is just hanging.

I set up

ServerAlias www.yourdomain.com

As well as

ServerName yourdomain.com

When I navigate to "yourdomain.com" it works as expected.

But when I type: https://www.yourdomain.com chromium says "Establishing a secure connection" in the bottom right hand corner,

I enabled mod_ssl debug level logging but nothing is being logged when I type in url with www. My end goal is to redirect www to my root domain https://yourdomain.com. Any help would be greatly appreciated.

I am using namecheap's free dynamic dns:

Hostname,  IPADDRESS URL,         RECORD TYPE, TTL

@          m.y.i.p                A Address    1800
www        https://yourdomain.com URL Redirect 1800

SUb Domain SEttings:
*          https://yourdomain.com URL Redirect 1800

For subdomain settings, I also tried https://*.yourdomain.com

THank you

share|improve this question
    
What's your DNS configuration look like for the www name? And can you show us the output of apachectl -S? –  Shane Madden Feb 6 at 23:06

1 Answer 1

up vote 3 down vote accepted

The URL redirect configuration in your DNS provider's name servers won't work with SSL.

The implementation of that kind of redirect really means that the provider has an A record configured on that name that points to servers of theirs, which then send HTTP redirects.

Those servers sending the redirects don't have any way to have a valid SSL certificate for your domain, so they listen on HTTP only - HTTPS connections will always fail.

Your server will need to be serving the HTTPS connections directly for the www name (then sending a redirect itself if that's desired) - change your record for the www name to an A or CNAME pointing to your server (if a CNAME, then point it to yourdomain.com.).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.