I am implementing my own proxy in purpose to record HTTP traffic. From what I researched so far this is not trivial since the first request (CONNECT) is done without encryption over HTTP (on port 443 - using regular server socket) proceeding with tunneling to SSL over HTTP (HTTPS) which needs to be handled by a secured server socket (taken from SLServerSocketFactory).
In other words, I will need to switch implementations from non-secure to secure server socket after the first CONNECT request.
In addition to that, I am taking care of using a custom keystore and trustore which is based on the server cert (no problem with this step).
Appreciate your thoughts or any examples you might have.
It's extremely trivial.
So when EOS has been read in both directions, both sockets are closed and both threads have exited. This shutdown technique takes care of all possible keep-alive difficulties.
As you are copying bytes, you don't care in the slightest what's in them. The client will do all the SSL stuff with the upstream server. You don't need to know anything about it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.