Java Tip 111: Implement HTTPS tunneling with JSSE

Create your own HTTPS tunneling socket for your Java Secure Socket Extension application

1 2 Page 2
Page 2 of 2

The complete source code for the SSLTunnelSocketFactory and the application code that connects to a secure URL using proxy tunneling is included in Resources. To compile and run the application, you would need to download and install Sun's JSSE from its Website, also listed in Resources.

Conclusion

If your JSSE application could not tunnel through your organization's firewall, you need to implement your own tunneling socket. The sample code included with the JSSE distribution shows you how to open an SSL socket tunnel. This article goes one step further to show you how to pass the tunneling socket to the HTTPS URL stream handler, and saves you the trouble of rewriting a http handler.

Pua Yeow Cheong is a software engineer with IBM Emerging Technology Center in Singapore, creating Java solutions for e-commerce and pervasive computing. His work involves dynamic transcoding of secure Web content into WML for display on WAP devices. The views expressed in this article are the author's and do not represent the view of IBM or any of its affiliated companies.

Learn more about this topic

1 2 Page 2
Page 2 of 2