You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/09/14 13:51:14 UTC

DO NOT REPLY [Bug 36655] New: - mod_jk 1.2.12+ does not submit correct request port number to tomcat

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36655>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36655

           Summary: mod_jk 1.2.12+ does not submit correct request port
                    number to tomcat
           Product: Tomcat 4
           Version: 4.1.31
          Platform: Other
        OS/Version: Solaris
            Status: NEW
          Severity: major
          Priority: P2
         Component: Connector:JK/AJP
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: stefan.labich@fiducia.de


In our infrastructure a https request is handled in this way:  
  
https request(port 443) ->   
SSL-accelerator (Nortel/Alteon) ->  
decrypted request port 50443 ->   
Apache-2.0.53 listening on 80, 55443 using virtual hosts ->  
mod_jk 1.2.12, AJP13 port 8200 ->  
Tomcat 4.1.31 with application  
  
The application checks wether a request hit the Apache2 on port 55443 or 80. If  
the port was 80, a warning message is sent back to the client about unencrypted  
traffic.  
  
Now we got the warning message also with a request on port 55443.  
mod_jk logs in debug mode:  
  
[Fri Sep 09 11:28:20 2005] [22238:0006] [debug] init_ws_service::mod_jk.c  
(510): Service pro  
tocol=HTTP/1.1 method=GET host=(null) addrr=192.168.70.130  
name=jportal1-riat-p.bap.fiducia.  
de port=80 auth=(null) user=(null) laddr=10.253.52.65 raddr=192.168.70.130  
  
So there is a wrong port number sent to Tomcat/application.  
  
I have traced the problem down to  
jakarta-tomcat-connectors-1.2.12-src/jk/native/apache-2.0/mod_jk.c where I've  
found the following:  
  
    /* get the real port (otherwise redirect failed) */  
    /* XXX: use apache API for getting server port  
     *  
     * Pre 1.2.7 versions used:  
     * s->server_port = r->connection->local_addr->port;  
     */  
    s->server_port  = ap_get_server_port(r);  
  
So I uncommented the old code and commented the new line: 
 
    /* get the real port (otherwise redirect failed) */ 
    /* XXX: use apache API for getting server port 
     * 
     * Pre 1.2.7 versions used: */ 
     s->server_port = r->connection->local_addr->port; 
 
/*    s->server_port  = ap_get_server_port(r); */ 
 
Now the mod_jk log says: 
 
[Fri Sep 09 13:15:10 2005] [22238:0006] [debug] init_ws_service::mod_jk.c  
(510): Service pro  
tocol=HTTP/1.1 method=GET host=(null) addrr=192.168.70.130  
name=jportal1-riat-p.bap.fiducia.  
de port=55443 auth=(null) user=(null) laddr=10.253.52.65 raddr=192.168.70.130  
 
The port is now sent correctly to Tomcat/application.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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