Networking and Internet #ssl 2 min

sslproxy

Translation of the original in Catalan. Read it in: CatalàCastellano

The sslproxy is a little tool of those that are really damn good... what does it do? well the name says it all:

SSL Proxy server listens on a TCP port, accepts SSL connections, and forwards them to another local or remote TCP port. For example, it is possible to create an HTTPS server if you have an HTTP server and you run an SSL Proxy server on port 443 which forwards the connections to port 80. SSL Proxy's design makes it as secure as possible and still perform well.

A little example where you can see how it works. We send an HTTPs request from our browser to the sslproxy and it will forward the request to a TCP server (netcat) and we will be able to see the browser fingerprint of our browser. Or put more simply, the HTTP request of our browser, without the S. That is, without SSL.

We put the TCP server (netcat) listening on port 8000:

nc -l p 8000

We launch the sslproxy with its corresponding SSL certificate:

ssl_proxy -s 443 -d -c 8000 -C server-cert.pem -K server-key.pem

We go to the browser and in the address bar we type:

https://localhost

If we look at nc we will see that there is the HTTP request we were sending:

GET / HTTP/1.0
Host: localhost
Accept: text/html, text/plain, application/vnd.sun.xml.writer, application/vnd.sun.xml.writer.global, application/vnd.stardivision.writer, application/vnd.stardivision.writer-global, application/x-starwriter, application/vnd.sun.xml.writer.template
Accept: application/msword, application/vnd.sun.xml.calc, application/vnd.stardivision.calc, application/x-starcalc, application/vnd.sun.xml.calc.template, application/excel, application/msexcel, application/vnd.ms-excel, application/x-msexcel
Accept: application/vnd.sun.xml.impress, application/vnd.stardivision.impress, application/vnd.stardivision.impress-packed, application/x-starimpress, application/vnd.sun.xml.impress.template, application/powerpoint, application/mspowerpoint
Accept: application/vnd.ms-powerpoint, application/x-mspowerpoint, application/vnd.sun.xml.draw, application/vnd.stardivision.draw, application/x-stardraw, application/vnd.sun.xml.draw.template, application/vnd.sun.xml.math
Accept: application/vnd.stardivision.math, application/x-starmath, text/sgml, video/mpeg, image/jpeg, image/tiff, image/x-rgb, image/png, image/x-xbitmap, image/x-xbm, image/gif, application/postscript, */*;q=0.01
Accept-Encoding: gzip, compress
Accept-Language: en
User-Agent: Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7e

The example is a bit lame at a functional level, but I think that at a conceptual level it makes very clear what the functionality the sslproxy offers us is. Especially if we have programmed an application that has no SSL support and we want to add it, it would be as simple as applying what I explain here.

2 comments

Comments from the old blog, as they were written. Comments are closed.

  1. Carita

  2. CJT