I am in the proces of coding a proxy server in C and am having difficulty with the SSL aspect.
When receiving an http request, I simply forward the whole message (GET htpp;//host.com \n User-Agent:...\n etc. ) to the appropriate server, and it works fine. But when an SSL request arrives (CONNECT host.com:443 \n User-Agent:...\n etc.), I try to forward this to the server in the same fashion.
This does not work as I am not getting any response back (not even an error). I think I have to manipulate the request message (ex. remove the "CONNECT" and ":443", but I am not sure how to properly format it. After several tries with different formats, I am still lost and frustrated.
Anyone know how to format the SSL message. i.e. What should my proxy forward to the secure server? Or maybe, formatting is not the solution?!? Any help appreciated.
Thanks,
ateball
When receiving an http request, I simply forward the whole message (GET htpp;//host.com \n User-Agent:...\n etc. ) to the appropriate server, and it works fine. But when an SSL request arrives (CONNECT host.com:443 \n User-Agent:...\n etc.), I try to forward this to the server in the same fashion.
This does not work as I am not getting any response back (not even an error). I think I have to manipulate the request message (ex. remove the "CONNECT" and ":443", but I am not sure how to properly format it. After several tries with different formats, I am still lost and frustrated.
Anyone know how to format the SSL message. i.e. What should my proxy forward to the secure server? Or maybe, formatting is not the solution?!? Any help appreciated.
Thanks,
ateball