title: PHP openssl_public_encrypt causing Page Timeout/Connection Reset?
body: <p>Just migrated to a new machine and having issues. </p>
  
  <p><em><strong>Note: This is a Windows 7 , Apache 2.2.21, MySQL 5.5.16, php 5.3.8 setup.</em></strong></p>
  
  <p>Each time I run a certain PHP script, I am faced with a "Page Load Error - The connection was reset". I know the script works before the function call with various echo statements but calling:</p>
  
  <blockquote>
    <p>openssl_public_encrypt();</p>
  </blockquote>
  
  <p>I am given a page timeout.  I have added the appropriate openssl.dll PATH to my windows configuration settings (D:\xampp\php\etc) but I am still getting page timeout errors on my actual localhost machine (and the errors above).</p>
  
  <p>The page returns:</p>
  
  <blockquote>
    <p><strong>The connection was reset</strong></p>
    
    <ul>
    <li>The connection to the server was reset while the page was loading.</li>
    </ul>
  </blockquote>
  
  <p>The apache ssl logs show:</p>
  
  <blockquote>
    <p>[Wed Dec 07 15:13:17 2011] [info] Loading certificate &amp; private key of SSL-aware server </p>
    
    <p>[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_pphrase.c(470): unencrypted RSA private key - pass phrase not required</p>
    
    <p>[Wed Dec 07 15:13:17 2011] [info] Configuring server for SSL protocol</p>
    
    <p>[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(465): Creating new SSL context (protocols: SSLv2, SSLv3, TLSv1)</p>
    
    <p>[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(420): Configuring TLS extension handling</p>
    
    <p>[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(795): Configuring RSA server certificate</p>
    
    <p>[Wed Dec 07 15:13:17 2011] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!? </p>
    
    <p>[Wed Dec 07 15:13:17 2011] [debug] ssl_engine_init.c(834): Configuring RSA server private key</p>
  </blockquote>
  
  <p>PHPinfo() shows:</p>
  
  <p>**</p>
  
  <h2>openssl</h2>
  
  <p>**</p>
  
  <pre><code>OpenSSL support          |  enabled
  ----------------------------------------------------------
  OpenSSL Library Version  |  OpenSSL 1.0.0e 6 Sep 2011
  ----------------------------------------------------------
  OpenSSL Header Version   |  OpenSSL 0.9.8r 8 Feb 2011 
  </code></pre>
  
  <p>-</p>
  
  <p>Shouldn't my library and header versions match? Could this be the cause of my error?</p>