title: Forward SSL Client certificate using php_curl
body: <p>I have the following setup:</p>
  
  <p>There are 2 servers that require an SSL client certificate. 
  The certificate is used for authentication.</p>
  
  <p>A user (using his browser) will do a request to Server1, with his client certificate.
  So far, so good.
  Now, what I want to do:
  Server1 will do a request to Server2, parse that response, and return it to the user.</p>
  
  <p>Server1 does the request with php_curl.
  I want Server1 to pass the original client certificate (of the user) to Server2 (which will verify the user, ..). Server1 is then posting 'on behalf of' the user.</p>
  
  <p>Is this possible?</p>
  
  <p>Apache has ExportCertData SSLOption enabled.
  I already tried to add the following headers to the curl options (figuring this was about the same as Apache proxy setup with client certs):</p>
  
  <pre><code>$headers[] = "SSL_CLIENT_S_DN: ".$_SERVER['SSL_CLIENT_S_DN'];
  $headers[] = "SSL_CLIENT_I_DN: ".$_SERVER['SSL_CLIENT_I_DN'];
  $headers[] = "SSL_SERVER_S_DN_OU: ".$_SERVER['SSL_SERVER_S_DN_OU'];
  $headers[] = "SSL_CLIENT_VERIFY: ".$_SERVER['SSL_CLIENT_VERIFY'];
  $headers[] = "SSL_CLIENT_V_START: ".$_SERVER['SSL_CLIENT_V_START'];
  $headers[] = "SSL_CLIENT_V_END: ".$_SERVER['SSL_CLIENT_V_END'];
  $headers[] = "SSL_CLIENT_M_VERSION: ".$_SERVER['SSL_CLIENT_M_VERSION'];
  $headers[] = "SSL_CLIENT_M_SERIAL: ".$_SERVER['SSL_CLIENT_M_SERIAL'];
  $headers[] = "SSL_CLIENT_CERT: ".$_SERVER['SSL_CLIENT_CERT'];
  $headers[] = "SSL_CLIENT_VERIFY: ".$_SERVER['SSL_CLIENT_VERIFY'];
  $headers[] = "SSL_SERVER_M_VERSION: ".$_SERVER['SSL_SERVER_M_VERSION'];
  $headers[] = "SSL_SERVER_I_DN: ".$_SERVER['SSL_SERVER_I_DN'];
  $headers[] = "SSL_SERVER_CERT: ".$_SERVER['SSL_SERVER_CERT'];
  </code></pre>
  
  <p>but no luck with those.</p>