You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joao Batistella <jo...@ptinovacao.pt> on 2004/03/12 13:59:33 UTC

Switching from HTTPS to HTTP

Hello!

In my application the login page uses HTTPS to send username and password to
the server. But after that, if login operation succeed, I want to send the
user to the main application page using HTTP protocol, not HTTPS. How can I
switch?

Thanks in advance,
JP

Re: Switching from HTTPS to HTTP

Posted by Mark Lowe <ma...@talk21.com>.
There's some java thingy you can use to do this, sslext or something..

If you are using apache for your webserver you can use mod_rewrite 
which means less hassle configuring development envionments and such 
like.

Here's an example.

NameVirtualHost machinedomain.net:80

<VirtualHost  www.sparrow.com:80>
         DocumentRoot /www/www.sparrow.com
         SSLEngine off
         RewriteEngine on
         RewriteCond %{SERVER_PORT} ^80$
         RewriteRule ^\/checkout 
https://%{SERVER_NAME}%{REQUEST_FILENAME} [R,L]
         RewriteRule ^\/admin https://%{SERVER_NAME}%{REQUEST_FILENAME} 
[R,L]

</VirtualHost>

Listen *:443
NameVirtualHost [i used the ip here]:443

<VirtualHost www.sparrow.com:443>
         DocumentRoot /www/www.sparrow.com
         SSLEngine on
         RewriteEngine on
         RewriteCond %{SERVER_PORT} ^443$
         RewriteRule !^(\/checkout)|(\/admin) 
http://%{SERVER_NAME}%{REQUEST_FILE
NAME} [R,L]

         SSLCertificateFile /[apache home]/conf/ssl.crt/server.crt
         SSLCertificateKeyFile /[apache home]/conf/ssl.key/server.key
         SSLCACertificateFile /[apache home]/conf/ssl.crt/intermediate.ca
</VirtualHost>


and requests containing /admin or /checkout will have https scheme 
forced those that are not wont.

On 12 Mar 2004, at 13:59, Joao Batistella wrote:

> Hello!
>
> In my application the login page uses HTTPS to send username and 
> password to
> the server. But after that, if login operation succeed, I want to send 
> the
> user to the main application page using HTTP protocol, not HTTPS. How 
> can I
> switch?
>
> Thanks in advance,
> JP


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org