fockopen: Failed to enable crypto
<p>Similar questions have been answered before, but I haven't been able to solve this particular case.</p>

<p>On a PHP 5.6+ machine when I try to use fsockopen on a particular domain I receive the following (not the real domain):</p>

<pre><code>$ php -r "var_dump(fsockopen(\"ssl://www.domain.net\", 9085, \$errnum, \$errstr, 5));"
PHP Warning:  fsockopen(): Failed to enable crypto in Command line code on line 1
PHP Warning:  fsockopen(): unable to connect to ssl://www.domain.net:9085 (Unknown error) in Command line code on line 1
bool(false)
</code></pre>

<p>This works fine on PHP 5.5, which points to it being by the change in 5.6 dealing with the way fsockopen verifies ssl certificates.</p>

<p>Other connections can be made without issue:</p>

<pre><code>$ php -r "var_dump(fsockopen(\"ssl://www.google.com\", 443, \$errnum, \$errstr, 5));"
resource(4) of type (stream)
</code></pre>

<p>Based on other suggestions I've checked the default cert file</p>

<pre><code>$ php -r "print_r(openssl_get_cert_locations());"
Array
(
    [default_cert_file] =&gt; /usr/lib/ssl/cert.pem
    [default_cert_file_env] =&gt; SSL_CERT_FILE
    [default_cert_dir] =&gt; /usr/lib/ssl/certs
    [default_cert_dir_env] =&gt; SSL_CERT_DIR
    [default_private_dir] =&gt; /usr/lib/ssl/private
    [default_default_cert_area] =&gt; /usr/lib/ssl
    [ini_cafile] =&gt;
    [ini_capath] =&gt;
)
</code></pre>

<p>The file <code>/usr/lib/ssl/cert.pem</code> was originally missing, I download the ca bundle from curl and renamed it to match.  Still no luck.</p>

<p>I'm not receiving any additional information indicating that verifying the certificate fails.  Are there any other ways to debug the issue?</p>