Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

HTTPS request forward as TCP

Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have a peculiar situation here that I must forward a HTTP request as a TCP connection.

Basically, I have a backend server that only accepts TCP connections that assumes a certain type of content/message. I would need to send a message from public internet to this server.

Due to sending over the public network, I would need to protect the message contents and it was decided that the message was sent as the payload of a HTTPS request.

The conclusion so far (from our limited knowledge) is that we have two options:
1. Write a custom webserver that accepts such connections and forwards the message to the backend server.
2. Use Tomcat or other servlet containers to help in the HTTPS authentication and stuff; with a web app that accepts the request and strips the headers and send the raw message through sockets to the backend synchronously (need to reply to request from backend).

To add, I would have to perform both client and server authentication.

I'm wondering has anyone has had similar experience?
Is there also a way just to use HTTP servers (like Apache HTTP, IBM HTTP) to directly strip and forward the request to my backend server?

Thanks for any pointers. Greatly appreciated.

With Regards,
Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be much easier to let a servlet container handle about all the security and networking issues instead of writing your own.

Since this is kind of a specialized thing to be doing, I doubt that Apache httpd can do anything like it out of the box. But you could certainly write an Apache module that can handle it.
Terry Ong
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

Thanks for your reply and tip on writing an Apache module.
Seems that writing the servlet is the easiest way.

Let's hope my performance doesn't gets affected too much,
What's that smell? Hey, sniff this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic