• 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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,
Terry.
 
Rancher
Posts: 43011
76
  • 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,
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!