apache - vhosts without SSL cert setup redirect to other vhosts that use SSL -


i'm running apache on multi-tenant server vhost sites configured.

so have vhost domain1.com has ssl cert defined in vhost file. have domain2.com not have ssl cert defined. if visit https://domain2.com, browser pulls website domain1.com, of course displays broken ssl cert warning in browser.

the way i'm trying correct is:

first, in vhost.conf file domain2 i've put this:

 <virtualhost ip:443>    servername domain2.com    documentroot /var/www/domain2/    sslengine on    sslcertificatefile /var/certs/cert.crt    sslcertificatekeyfile /var/certs/cert.key    redirect permanent / http://www.domain2.com    </virtualhost>   

of course client doesn't own own ssl certificate, i'm pointing certificate file 1 of our domains. in instances gives certificate warning user when visit https://www.domain2.com or https://domain2.com. (in chrome can go https://domain2.com , redirected without warning)

of course generating self-signed cert use purpose throws cert warning. if remove "sslengine on" directive don't have specify cert @ all, breaks ssl on entire server , no sites work right.

how can without having worry users getting certificate warning, , redirect https requests domain2.com http?

you can't.
way have proper redirect without certificate warnings have proper certificate domain want redirect from.

a redirect done @ http level, inside tls tunnel created https connection. clients first needs create tls connection before can redirect. creating tls connection results in certificate issue because name in url , in certificate not match.

another way move ssl hosts 1 ip address , other hosts ip address. way client not certificate warning see there no https on address.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -