You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark Johnson <ma...@gilanet.com> on 2001/04/25 00:50:22 UTC

Re: mod_ssl breaks response.encodeURL()? !SOLUTION!

Thanks to a tip from maciejka@tiger.com.pl, I've got this working on Tomcat
3.2.1 with gnu/linux+apache+mod_ssl.

Here's HOWTO:
1. Get jsse-1.0.2-do.zip and unpack. In lib/ are three jars. Put 'em in your
CLASSPATH.
2. Patch:
$JAKARTA_HOME/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletResponseFacade.java

with:

            return (false);
        if (!request.getServerName().equalsIgnoreCase(url.getHost()))
            return (false);
-        // Set the URL port to HTTP default if not available before
comparing
+        // Set the URL port to protocol default if not available before
comparing
         int urlPort = url.getPort();
         if (urlPort == -1) {
-            urlPort = 80;
+            if("http".equalsIgnoreCase(url.getProtocol())) {
+                urlPort = 80;
+            } else if ("https".equalsIgnoreCase(url.getProtocol())) {
+                urlPort = 443;
+            }
         }

3. compile the class file to
$TOMCAT_HOME/classes/org/apache/tomcat/facade/HttpServletResponseFacade.class

4. Done!

Mark Johnson wrote:

> My app uses the HttpSession interface. In order to handle client
> browsers which don't accept cookies, I used the
> response.encodeURL("myURL") method.
>
> Using apache without mod_ssl, and using a browser set to deny cookies, I
> detect the method in action when the jsessionid is appended to the
> URL's. Everything is dandy!
>
> However, when I run apache with mod_ssl, it is as if the method has not
> been invoked.
>
> I speculate that this effect is related to mod_ssl's use of another
> port, 443. Perhaps response.encodeURL("myURL") only works on the port
> number in httpd.conf's Port directive.
>
> Can anyone explain what's going on? Better yet, how do I solve the
> problem?
>
> TIA


Re: mod_ssl breaks response.encodeURL()? !SOLUTION!

Posted by Jeff Kilbride <je...@kilbride.com>.
I've been reading the tomcat-dev list and it seems some other bugs have
popped up in 3.2.2. So, they will most likely release another beta before
releasing 3.2.2 final.

Thanks,
--jeff

----- Original Message -----
From: "Wolle" <wo...@dorf.RWTH-Aachen.DE>
To: <to...@jakarta.apache.org>
Sent: Tuesday, April 24, 2001 4:27 PM
Subject: Re: mod_ssl breaks response.encodeURL()? !SOLUTION!


> Yes, i have asked it, and I get these followed answer :
>
> I finished this today (4/16/01).  There are a couple other loose ends that
> need to be resolved before I release 3.2.2.  If you can build and run from
> source then please try the lastest code from CVS and make sure it
addresses
> your need.
>
> from marc.saegesser@apropos.com
>
>
> Greetings,
> Michael
>
> Jeff Kilbride wrote:
>
> > Has this fix been added to 3.2.2? I seem to remember seeing that it had
> > been.
> >
> > Thanks,
> > --jeff
> >
> > ----- Original Message -----
> > From: "Mark Johnson" <ma...@gilanet.com>
> > To: <to...@jakarta.apache.org>
> > Sent: Tuesday, April 24, 2001 3:50 PM
> > Subject: Re: mod_ssl breaks response.encodeURL()? !SOLUTION!
> >
> > > Thanks to a tip from maciejka@tiger.com.pl, I've got this working on
> > Tomcat
> > > 3.2.1 with gnu/linux+apache+mod_ssl.
> > >
> > > Here's HOWTO:
> > > 1. Get jsse-1.0.2-do.zip and unpack. In lib/ are three jars. Put 'em
in
> > your
> > > CLASSPATH.
> > > 2. Patch:
> > >
> >
$JAKARTA_HOME/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletR
> > esponseFacade.java
> > >
> > > with:
> > >
> > >             return (false);
> > >         if (!request.getServerName().equalsIgnoreCase(url.getHost()))
> > >             return (false);
> > > -        // Set the URL port to HTTP default if not available before
> > > comparing
> > > +        // Set the URL port to protocol default if not available
before
> > > comparing
> > >          int urlPort = url.getPort();
> > >          if (urlPort == -1) {
> > > -            urlPort = 80;
> > > +            if("http".equalsIgnoreCase(url.getProtocol())) {
> > > +                urlPort = 80;
> > > +            } else if ("https".equalsIgnoreCase(url.getProtocol())) {
> > > +                urlPort = 443;
> > > +            }
> > >          }
> > >
> > > 3. compile the class file to
> > >
> >
$TOMCAT_HOME/classes/org/apache/tomcat/facade/HttpServletResponseFacade.clas
> > s
> > >
> > > 4. Done!
> > >
> > > Mark Johnson wrote:
> > >
> > > > My app uses the HttpSession interface. In order to handle client
> > > > browsers which don't accept cookies, I used the
> > > > response.encodeURL("myURL") method.
> > > >
> > > > Using apache without mod_ssl, and using a browser set to deny
cookies, I
> > > > detect the method in action when the jsessionid is appended to the
> > > > URL's. Everything is dandy!
> > > >
> > > > However, when I run apache with mod_ssl, it is as if the method has
not
> > > > been invoked.
> > > >
> > > > I speculate that this effect is related to mod_ssl's use of another
> > > > port, 443. Perhaps response.encodeURL("myURL") only works on the
port
> > > > number in httpd.conf's Port directive.
> > > >
> > > > Can anyone explain what's going on? Better yet, how do I solve the
> > > > problem?
> > > >
> > > > TIA
> > >
>
>
>


Re: mod_ssl breaks response.encodeURL()? !SOLUTION!

Posted by Wolle <wo...@dorf.RWTH-Aachen.DE>.
Yes, i have asked it, and I get these followed answer :

I finished this today (4/16/01).  There are a couple other loose ends that
need to be resolved before I release 3.2.2.  If you can build and run from
source then please try the lastest code from CVS and make sure it addresses
your need.

from marc.saegesser@apropos.com


Greetings,
Michael

Jeff Kilbride wrote:

> Has this fix been added to 3.2.2? I seem to remember seeing that it had
> been.
>
> Thanks,
> --jeff
>
> ----- Original Message -----
> From: "Mark Johnson" <ma...@gilanet.com>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, April 24, 2001 3:50 PM
> Subject: Re: mod_ssl breaks response.encodeURL()? !SOLUTION!
>
> > Thanks to a tip from maciejka@tiger.com.pl, I've got this working on
> Tomcat
> > 3.2.1 with gnu/linux+apache+mod_ssl.
> >
> > Here's HOWTO:
> > 1. Get jsse-1.0.2-do.zip and unpack. In lib/ are three jars. Put 'em in
> your
> > CLASSPATH.
> > 2. Patch:
> >
> $JAKARTA_HOME/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletR
> esponseFacade.java
> >
> > with:
> >
> >             return (false);
> >         if (!request.getServerName().equalsIgnoreCase(url.getHost()))
> >             return (false);
> > -        // Set the URL port to HTTP default if not available before
> > comparing
> > +        // Set the URL port to protocol default if not available before
> > comparing
> >          int urlPort = url.getPort();
> >          if (urlPort == -1) {
> > -            urlPort = 80;
> > +            if("http".equalsIgnoreCase(url.getProtocol())) {
> > +                urlPort = 80;
> > +            } else if ("https".equalsIgnoreCase(url.getProtocol())) {
> > +                urlPort = 443;
> > +            }
> >          }
> >
> > 3. compile the class file to
> >
> $TOMCAT_HOME/classes/org/apache/tomcat/facade/HttpServletResponseFacade.clas
> s
> >
> > 4. Done!
> >
> > Mark Johnson wrote:
> >
> > > My app uses the HttpSession interface. In order to handle client
> > > browsers which don't accept cookies, I used the
> > > response.encodeURL("myURL") method.
> > >
> > > Using apache without mod_ssl, and using a browser set to deny cookies, I
> > > detect the method in action when the jsessionid is appended to the
> > > URL's. Everything is dandy!
> > >
> > > However, when I run apache with mod_ssl, it is as if the method has not
> > > been invoked.
> > >
> > > I speculate that this effect is related to mod_ssl's use of another
> > > port, 443. Perhaps response.encodeURL("myURL") only works on the port
> > > number in httpd.conf's Port directive.
> > >
> > > Can anyone explain what's going on? Better yet, how do I solve the
> > > problem?
> > >
> > > TIA
> >




Re: mod_ssl breaks response.encodeURL()? !SOLUTION!

Posted by Wolle <wo...@dorf.RWTH-Aachen.DE>.
Hello,
in the TC3.2.2b4 version you don't have to patch the
HttpServletResponseFacade.java, it's already implemented
you must only do this:
1. copy  jnet.jar and jsse.jar in your TC/lib dir
2. set
TOMCAT_OPTS=-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol

Greetings,
Michael

Jeff Kilbride wrote:

> Has this fix been added to 3.2.2? I seem to remember seeing that it had
> been.
>
> Thanks,
> --jeff
>
> ----- Original Message -----
> From: "Mark Johnson" <ma...@gilanet.com>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, April 24, 2001 3:50 PM
> Subject: Re: mod_ssl breaks response.encodeURL()? !SOLUTION!
>
> > Thanks to a tip from maciejka@tiger.com.pl, I've got this working on
> Tomcat
> > 3.2.1 with gnu/linux+apache+mod_ssl.
> >
> > Here's HOWTO:
> > 1. Get jsse-1.0.2-do.zip and unpack. In lib/ are three jars. Put 'em in
> your
> > CLASSPATH.
> > 2. Patch:
> >
> $JAKARTA_HOME/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletR
> esponseFacade.java
> >
> > with:
> >
> >             return (false);
> >         if (!request.getServerName().equalsIgnoreCase(url.getHost()))
> >             return (false);
> > -        // Set the URL port to HTTP default if not available before
> > comparing
> > +        // Set the URL port to protocol default if not available before
> > comparing
> >          int urlPort = url.getPort();
> >          if (urlPort == -1) {
> > -            urlPort = 80;
> > +            if("http".equalsIgnoreCase(url.getProtocol())) {
> > +                urlPort = 80;
> > +            } else if ("https".equalsIgnoreCase(url.getProtocol())) {
> > +                urlPort = 443;
> > +            }
> >          }
> >
> > 3. compile the class file to
> >
> $TOMCAT_HOME/classes/org/apache/tomcat/facade/HttpServletResponseFacade.clas
> s
> >
> > 4. Done!
> >
> > Mark Johnson wrote:
> >
> > > My app uses the HttpSession interface. In order to handle client
> > > browsers which don't accept cookies, I used the
> > > response.encodeURL("myURL") method.
> > >
> > > Using apache without mod_ssl, and using a browser set to deny cookies, I
> > > detect the method in action when the jsessionid is appended to the
> > > URL's. Everything is dandy!
> > >
> > > However, when I run apache with mod_ssl, it is as if the method has not
> > > been invoked.
> > >
> > > I speculate that this effect is related to mod_ssl's use of another
> > > port, 443. Perhaps response.encodeURL("myURL") only works on the port
> > > number in httpd.conf's Port directive.
> > >
> > > Can anyone explain what's going on? Better yet, how do I solve the
> > > problem?
> > >
> > > TIA
> >

--
__
Gruss,
Wolle

-------------------------------------------------------
                      mwollenhaupt@web.de



Re: mod_ssl breaks response.encodeURL()? !SOLUTION!

Posted by Mark Johnson <ma...@gilanet.com>.
From:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=578
(on 2001.4.16) "The fix has been committed to 3.2.2, but has not 3.3."

Jeff Kilbride wrote:

> Has this fix been added to 3.2.2? I seem to remember seeing that it had
> been.
>
> Thanks,
> --jeff
>
> ----- Original Message -----
> From: "Mark Johnson" <ma...@gilanet.com>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, April 24, 2001 3:50 PM
> Subject: Re: mod_ssl breaks response.encodeURL()? !SOLUTION!
>
> > Thanks to a tip from maciejka@tiger.com.pl, I've got this working on
> Tomcat
> > 3.2.1 with gnu/linux+apache+mod_ssl.
> >
> > Here's HOWTO:
> > 1. Get jsse-1.0.2-do.zip and unpack. In lib/ are three jars. Put 'em in
> your
> > CLASSPATH.
> > 2. Patch:
> >
> $JAKARTA_HOME/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletR
> esponseFacade.java
> >
> > with:
> >
> >             return (false);
> >         if (!request.getServerName().equalsIgnoreCase(url.getHost()))
> >             return (false);
> > -        // Set the URL port to HTTP default if not available before
> > comparing
> > +        // Set the URL port to protocol default if not available before
> > comparing
> >          int urlPort = url.getPort();
> >          if (urlPort == -1) {
> > -            urlPort = 80;
> > +            if("http".equalsIgnoreCase(url.getProtocol())) {
> > +                urlPort = 80;
> > +            } else if ("https".equalsIgnoreCase(url.getProtocol())) {
> > +                urlPort = 443;
> > +            }
> >          }
> >
> > 3. compile the class file to
> >
> $TOMCAT_HOME/classes/org/apache/tomcat/facade/HttpServletResponseFacade.clas
> s
> >
> > 4. Done!
> >
> > Mark Johnson wrote:
> >
> > > My app uses the HttpSession interface. In order to handle client
> > > browsers which don't accept cookies, I used the
> > > response.encodeURL("myURL") method.
> > >
> > > Using apache without mod_ssl, and using a browser set to deny cookies, I
> > > detect the method in action when the jsessionid is appended to the
> > > URL's. Everything is dandy!
> > >
> > > However, when I run apache with mod_ssl, it is as if the method has not
> > > been invoked.
> > >
> > > I speculate that this effect is related to mod_ssl's use of another
> > > port, 443. Perhaps response.encodeURL("myURL") only works on the port
> > > number in httpd.conf's Port directive.
> > >
> > > Can anyone explain what's going on? Better yet, how do I solve the
> > > problem?
> > >
> > > TIA
> >


Re: mod_ssl breaks response.encodeURL()? !SOLUTION!

Posted by Jeff Kilbride <je...@kilbride.com>.
Has this fix been added to 3.2.2? I seem to remember seeing that it had
been.

Thanks,
--jeff

----- Original Message -----
From: "Mark Johnson" <ma...@gilanet.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, April 24, 2001 3:50 PM
Subject: Re: mod_ssl breaks response.encodeURL()? !SOLUTION!


> Thanks to a tip from maciejka@tiger.com.pl, I've got this working on
Tomcat
> 3.2.1 with gnu/linux+apache+mod_ssl.
>
> Here's HOWTO:
> 1. Get jsse-1.0.2-do.zip and unpack. In lib/ are three jars. Put 'em in
your
> CLASSPATH.
> 2. Patch:
>
$JAKARTA_HOME/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletR
esponseFacade.java
>
> with:
>
>             return (false);
>         if (!request.getServerName().equalsIgnoreCase(url.getHost()))
>             return (false);
> -        // Set the URL port to HTTP default if not available before
> comparing
> +        // Set the URL port to protocol default if not available before
> comparing
>          int urlPort = url.getPort();
>          if (urlPort == -1) {
> -            urlPort = 80;
> +            if("http".equalsIgnoreCase(url.getProtocol())) {
> +                urlPort = 80;
> +            } else if ("https".equalsIgnoreCase(url.getProtocol())) {
> +                urlPort = 443;
> +            }
>          }
>
> 3. compile the class file to
>
$TOMCAT_HOME/classes/org/apache/tomcat/facade/HttpServletResponseFacade.clas
s
>
> 4. Done!
>
> Mark Johnson wrote:
>
> > My app uses the HttpSession interface. In order to handle client
> > browsers which don't accept cookies, I used the
> > response.encodeURL("myURL") method.
> >
> > Using apache without mod_ssl, and using a browser set to deny cookies, I
> > detect the method in action when the jsessionid is appended to the
> > URL's. Everything is dandy!
> >
> > However, when I run apache with mod_ssl, it is as if the method has not
> > been invoked.
> >
> > I speculate that this effect is related to mod_ssl's use of another
> > port, 443. Perhaps response.encodeURL("myURL") only works on the port
> > number in httpd.conf's Port directive.
> >
> > Can anyone explain what's going on? Better yet, how do I solve the
> > problem?
> >
> > TIA
>