title: Creating a Java HTTPS Proxy in-order to record HTTP traffic
body: <p>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). </p>
  
  <p>In other words, I will need to switch implementations from non-secure to secure server socket after the first CONNECT request. </p>
  
  <p>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).</p>
  
  <p>Appreciate your thoughts or any examples you might have.</p>