So I am writing an HTTP proxy in python3 that works totally fine with plain http. The problem is, as soon as I try to switch to https, the thing breaks down. This might sound like a really simple, dump question, but bear with me here.
My approach is the following: The proxy provides a simple http server for the client to connect to. It reads the data sent by the client, makes a connection to the target server, and forwards the unmodified data.
So far I've done the HTTP server part, as of now it just responds to GET requests with a sample HTML page. So, lets say I can view the sample page in the browser at http://localhost:8080, I can then enter the same data into my proxy settings and automaticaly get back the sample page as a response to any HTTP GET request I make on the device.
So I thought I could do the same thing over HTTPS with a self signed SSL certificate, I used the same approach as above, I can access the sample page over a secure connection at https://localhost:8080, get no warning, since I installed the certificate on my client device, however, whenever I then try to make an HTTPS GET request, I get no response, the code that should serve the request does not even run.
Now, I know that this kind of interception is possible, since I've done it on the same device before, only through burp suite, which also uses a self signed certificate.
What am I missing here? How does burpsuite do it?
I can post my code if necessary to further help the understanding of my problem.
Also, sorry if this is not an especially interesting post that contributes a lot to this board, but since it is a long question, I thought it would warrant its own thread, maybe someone else can learn from it too.