title: How to provide valid SSL certificate with MITM attack?
body: <p>I'm writing a Ruby code that simulates a DNS Server and returns his own IP in case that the domain name does not exist.
  For example, in case that the server will get a request for google.com, it will refer to the real google's site. On the other hand, in case that the request will be to non-exist domain like ytjsdngfdsgmsdfg.com, it will return his own IP.
  On the server there is a apache server as well that returns a generic page who will be the response for all of these non-exist domain sites requests.</p>
  
  <p>I faced a problem with generate and provide a valid SSL certificate in case that the response will be my own apache server.
  Please remember that the domain name will be different each time, so generate one certificate will be not good enough.
  I need something that will return a valid SSL certificate for each domain name that my server will refer to his own apache server.
  Is there any solution to deal with it? </p>