Http and Https on the same port

347 views
Skip to first unread message

Richard Warburton

unread,
May 9, 2013, 6:52:07 AM5/9/13
to ve...@googlegroups.com
Hi,

I'm trying to get vertx to bind http and https servers on the same port.  Individually both my http and https servers work.  Unfortunately when they are both attached on the same port, it seems like the requests are round robin scheduled, so non-deterministically fails to work correctly.

Is there any way I can bind two httpserver instances to the same port but force the https connections to go to one of them, and the plain http connections to go the other?

regards,

  Richard Warburton

petermd

unread,
May 10, 2013, 10:25:55 AM5/10/13
to ve...@googlegroups.com
hi richard,

do you really want two distinct servers or do you just want http and https via a single port (eg because of restrictions of your service provider) aka port unification

i think you'd need to do the switching at the protocol layer. currently vertx sets up the channel based on configuration (http or https) however there is an example handler in netty (http://netty.io/3.6/xref/org/jboss/netty/example/portunification/PortUnificationServerHandler.html) that allows you to have a single handler that switches automatically to ssl if required (by recognising the ssl handshake in the initial request)

you'd need to patch HttpServer to add this functionality however - but it doesn't look too difficult (and might be useful if its a common problem for people on hosted platforms)

cheers,
peter
Reply all
Reply to author
Forward
0 new messages