title: Zend Framework cannot open ssl socket (Abstract.php)
body: <p>I'm configuring a Magento 1.9.1 to use an external SMTP to send emails, using SMTP PRO (<a href="https://www.magentocommerce.com/magento-connect/smtp-pro-email-free-custom-smtp-email.html" rel="nofollow noreferrer">https://www.magentocommerce.com/magento-connect/smtp-pro-email-free-custom-smtp-email.html</a>).</p>
  
  <p>I've setup the configuration (hostname, port, username, password) but when I try to send a test email it fails with a 'Could not open socket' error message. If I dig into the code I see that the error is generated from this piece of code in lib/Zend/Mail/Protocol/Abstract.php:</p>
  
  <pre><code>$this-&gt;_socket = @stream_socket_client($remote, $errorNum, $errorStr, self::TIMEOUT_CONNECTION);
  
          if ($this-&gt;_socket === false) {
              if ($errorNum == 0) {
                  $errorStr = $remote.' Could not open socket '.phpversion();
              }
              /**
               * @see Zend_Mail_Protocol_Exception
               */
              #require_once 'Zend/Mail/Protocol/Exception.php';
              throw new Zend_Mail_Protocol_Exception($errorStr);
          }
  </code></pre>
  
  <p>My PHP environment (5.6.30) has openssl support (see image and snippet below)
  <a href="https://i.stack.imgur.com/JbmIE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JbmIE.png" alt="SSL Support"></a></p>
  
  <pre><code>[root@ns3023903 httpdocs]# php -r 'print_r(stream_get_transports());'
  Array
  (
      [0] =&gt; tcp
      [1] =&gt; udp
      [2] =&gt; unix
      [3] =&gt; udg
      [4] =&gt; ssl
      [5] =&gt; sslv3
      [6] =&gt; sslv2
      [7] =&gt; tls
  )
  </code></pre>
  
  <p>There are no firewall issues as i can both telnet on the port 465 to the target host or send an email using the same SMTP using <em>phpmailer</em> with the same user I use to run the site virtualhost.</p>
  
  <p>I'm on a CentOS 7 64 bit server, with SELinux disabled and, if that matters, I'm using Plesk 12 to configure virtual hosts.</p>
  
  <p>Name resolution is also working ok (I can ping the SMTP name correctly and the IP address is looked up just fine).</p>
  
  <p>I'm obviously missing something here...but what?</p>