wood burning stoves 2.0*
The moose likes Tomcat and the fly likes https and http in the same port (tomcat) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "https and http in the same port (tomcat)" Watch "https and http in the same port (tomcat)" New topic
Author

https and http in the same port (tomcat)

alain martin
Ranch Hand

Joined: Apr 11, 2005
Posts: 43
I have configurated my tomcat server.xml file to serve http in 8080 port and https in 8443 port.

I would like to server both in the same port (8080) is it possible in tomcat?

Thanks


<a href="http://www.hhdirecto.net" target="_blank" rel="nofollow">http://www.hhdirecto.net</a>
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42367
    
  64
No, nor can any other server do it. HTTP and HTTPS are different protocols; they can't be handled on the same port.


Ping & DNS - my free Android networking tools app
alain martin
Ranch Hand

Joined: Apr 11, 2005
Posts: 43
Are you sure? I think I saw websites with http and https in same port (80). And a friend tell me he did in apache server...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42367
    
  64
I am sure. You might ask your friend what exactly he did.
Dominique Laurent
Greenhorn

Joined: Oct 02, 2008
Posts: 2
Well, actually you can: see http://www.ietf.org/rfc/rfc2817.txt

"The HTTP/1.1 Upgrade mechanism can apply TLS to an open HTTP connection"

E.g. a response such as

HTTP/1.1 426 Upgrade Required
Muhammad Hammad Ayaz
Greenhorn

Joined: Aug 05, 2010
Posts: 1
You cannot set same ports for both http and https. You would have seen websites in which ports are not visible in case of http and https. It doesn't mean that those websites use the same ports. If, you set the port for http to 80 and https to 443. The ports won't be showed in URL. In case of ports other than 80 and 443, they will be shown in the URL.
Michael Kato
Greenhorn

Joined: Aug 06, 2010
Posts: 12
If you did this, how would you know if it was using https or http? You'd never know if the parts that were supposed to be secure were secure. The browser certainly wouldn't be able to tell and subsequently the user.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: https and http in the same port (tomcat)