title: PHP - check SSL certificate of the request
body: <p>Is it possible for PHP to obtain the certificate of the request, and in particular the website name on the certificate and the CA?</p>
  
  <p>I want to check that a call to my PHP file can only be made from my website via an AJAX call. Like this:</p>
  
  <ol>
  <li>User logs onto my website and then uses https for subsequent interaction</li>
  <li>User loads a page <code>https:// domain/mypage.php</code></li>
  <li><code>https:// domain/mypage.php</code> has an AJAX call to <code>https:// domain/getinfo.php</code></li>
  </ol>
  
  <p>in getinfo.php I want to check the certificate details of the request to ensure that the request was made from my website, <em>i.e. not from a direct hit on the URL, or using a scraping tool.</em></p>
  
  <p>Possible?</p>