Bad request when users goto http://www.mydomain.com:443

Bad request when users goto http://www.mydomain.com:443

am 31.03.2008 18:34:38 von Dean Pullen

We get the following error:

Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Hint: https://www.mydomain.com/

When users go to http//www.mydomain.com:443 - which we obviously need to
catch and redirect to https://www.mydomain.com=20

What's the best way of achieving this?

We have two virtual hosts setup one on port 80 (which is already
redirecting http traffic on port 80 to https on port 443) and one on
443.=20
____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org

Re: Bad request when users goto http://www.mydomain.com:443

am 31.03.2008 19:06:13 von Glyn Astill

Possibly use a RewriteRule or something of the sort? RewriteEngine On=
=0ARewriteCond %{HTTP_HOST} .=0ARewriteCond %{HTTP_HOST} ^www\.mydomain\.co=
m$=0ARewriteCond %{SERVER_PORT} ^443$=0ARewriteRule ^(.*) https://www.mydom=
ain.com/$1 [R=3D301,L] I've not tested that, and I doub't it's spot on=
but hopefully it's the right direction... ----- Original Message ----=
=0A> From: Dean Pullen =0A> To: modssl-users@modssl=
...org=0A> Sent: Monday, 31 March, 2008 5:34:38 PM=0A> Subject: Bad request w=
hen users goto http://www.mydomain.com:443=0A> =0A> We get the following er=
ror:=0A> =0A> Bad Request=0A> =0A> Your browser sent a request that this se=
rver could not understand.=0A> Reason: You're speaking plain HTTP to an SSL=
-enabled server port.=0A> Instead use the HTTPS scheme to access this URL, =
please.=0A> =0A> Hint: https://www.mydomain.com/=0A> =0A> When users go=
to http//www.mydomain.com:443 - which we obviously need to=0A> catch and r=
edirect to https://www.mydomain.com =0A> =0A> What's the best way of achiev=
ing this?=0A> =0A> We have two virtual hosts setup one on port 80 (which is=
already=0A> redirecting http traffic on port 80 to https on port 443) and =
one on=0A> 443. =0A> ______________________________________________________=
________________=0A> Apache Interface to OpenSSL (mod_ssl) =
www.modssl.org=0A> User Support Mailing List modssl-=
users@modssl.org=0A> Automated List Manager majo=
rdomo@modssl.org=0A> =0A _________________________________=
_________________________=0ASent from Yahoo! Mail.=0AA Smarter Inbox http:/=
/uk.docs.yahoo.com/nowyoucan.html

____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org

Re: Bad request when users goto http://www.mydomain.com:443

am 31.03.2008 19:18:34 von walt.williams

The rewriterule can be explointed on unpatched Apache. If you're
doing this, make certain you're working with the current patch.

Otherwise, use an application layer redirector/load balancer.

Walt

On 3/31/08, Glyn Astill wrote:
> Possibly use a RewriteRule or something of the sort?
>
> RewriteEngine On
> RewriteCond %{HTTP_HOST} .
> RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
> RewriteCond %{SERVER_PORT} ^443$
> RewriteRule ^(.*) https://www.mydomain.com/$1 [R=301,L]
>
> I've not tested that, and I doub't it's spot on but hopefully it's the right direction...
>
> ----- Original Message ----
> > From: Dean Pullen
> > To: modssl-users@modssl..org
> > Sent: Monday, 31 March, 2008 5:34:38 PM
> > Subject: Bad request when users goto http://www.mydomain.com:443
> >
> > We get the following error:
> >
> > Bad Request
> >
> > Your browser sent a request that this server could not understand.
> > Reason: You're speaking plain HTTP to an SSL-enabled server port.
> > Instead use the HTTPS scheme to access this URL, please.
> >
> > Hint: https://www.mydomain.com/
> >
> > When users go to http//www.mydomain.com:443 - which we obviously need to
> > catch and redirect to https://www.mydomain.com
> >
> > What's the best way of achieving this?
> >
> > We have two virtual hosts setup one on port 80 (which is already
> > redirecting http traffic on port 80 to https on port 443) and one on
> > 443.
> > ____________________________________________________________ __________
> > Apache Interface to OpenSSL (mod_ssl) www.modssl.org
> > User Support Mailing List modssl-users@modssl.org
> > Automated List Manager majordomo@modssl.org
> >
>
>
>
>
> __________________________________________________________
> Sent from Yahoo! Mail.
> A Smarter Inbox http://uk.docs.yahoo.com/nowyoucan.html
>
> ____________________________________________________________ __________
> Apache Interface to OpenSSL (mod_ssl) www.modssl.org
> User Support Mailing List modssl-users@modssl.org
> Automated List Manager majordomo@modssl.org
>


--
Walt Williams, CISSP, SSCP
____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org