tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amos Shapira <amos.shap...@webcollage.com>
Subject RE: Tomcat 3.1 + HTTPS + redirects
Date Mon, 07 Aug 2000 09:29:39 GMT
Hmm,

First, it sounds possibly like a bug since the description of
javax.servlet.ServletRequest.getScheme() specifically lists "http" and
"https" as examples of possible return values.

Another way, not as clean as the originally proposed solution (which I
understand not to help), but maybe you can get the scheme and
add an "s" to it according to the return value of
javax.servlet.ServletRequest.isSecure()?

Also, are you 100% sure that https was actually used and not dropped
due to some certificate problems and such?

Cheers,

--Amos Shapira
WebCollage

> -----Original Message-----
> From: Jason Rumney [mailto:jrumney@att.com]
> Sent: Monday, August 07, 2000 12:00 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Tomcat 3.1 + HTTPS + redirects
> 
> 
> Jason Rumney <jrumney@att.com> writes:
> 
> > Eric Simpson <esimp@home.com> writes:
> > 
> > > I'm assuming its redirecting you to the internal web server
> > > name instead of the external name right?
> 
> To clarify: the problem is not the server name, it is the scheme. I am
> being redirected to http://... instead of https://...
> 
> > > I got around this by using this redirect code.
> > > 
> > > response.sendRedirect(request.getScheme() + "://" + 
> reqeust.getServerName()
> > > + ":" + request.getServerPort());
> > > 
> > > and it makes the code a lot more portable also. Hope this
> > > helps.
> > 
> > Thanks,
> > 
> > 
> > it seems response.sendRedirect(request.getScheme() + ":" + 
> encoded_url);
> > is sufficient to take care of my problem.
> 
> Actually, it seems that in my haste to get this resolved on Friday, I
> tested the wrong bit of code (it was doing a forward, not a redirect),
> and the above does not, in fact, work.
> 
> The problem is that request.getScheme() returns "http", even when the
> scheme being used is "https", so things are no better than using the
> bare relative URL.
> 
> Can anyone offer any suggestions on getting this working?
> 
> 
> -- 
> Jason Rumney <jrumney@att.com>
> AT&T Labs (Redditch, UK)
> 

Mime
View raw message