Hello Ralf,

I am also able to recreate this issue with php56u:

$ php -v
PHP 5.6.9 (cli) (built: May 15 2015 13:54:40) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

$ time php ssl_bug.php 
Connected to ssl://imap.ikmj.com:993
* OK ikmj.home.pl  IdeaImapServer v0.80 ready
1 CAPABILITY
2 LOGOUT

real    1m2.457s
user    0m0.012s
sys     0m0.008s

I still think this issue is tied with the cipher used in your
certificate.  Your certificate is using RC4-SHA and it appears that PHP
is disabling all RC4 ciphers[0].  I have tested with a few different
IMAP server that used ciphers on that list and did not run into any
issues.  You might want to try a test using a certificate with a ciphers
on that list.

-Ben


[0] https://github.com/php/php-src/blob/master/ext/openssl/php_openssl.h#L39-L45

-- 
You received this bug notification because you are a member of IUS Core
Development, which is subscribed to IUS Community Project.
https://bugs.launchpad.net/bugs/1446633

Title:
  SSL problem with PHP 5.6.7&.8 and Horde_Imap_Client

Status in IUS Community Project:
  New

Bug description:
  I created a simple example code reproducing the problem Horde or
  EGroupware:

  <?php
  $timeout = 30;
  $context = array(
      'ssl' => array(
          'verify_peer' => false,
          'verify_peer_name' => false
      )
  );
  if (($fp = stream_socket_client(
          $conn='ssl://imap.ikmj.com:993',
          $errno,
          $errstr,
          $timeout,
          STREAM_CLIENT_CONNECT,
          stream_context_create($context)
      )))
  {
      echo "Connected to $conn\n";
      echo fgets($fp);

      echo "1 CAPABILITY\n";
      fwrite($fp, "1 CAPABILITY\n");
      echo fgets($fp);
      echo "2 LOGOUT\n";
      fwrite($fp, "2 LOGOUT\n");
  }
  else var_dump($errno, $errstr);

  Running it on various IUS PHP versions gives following results:
  [root@lighttpd ~]# php -v
  PHP 5.4.39 (cli) (built: Mar 20 2015 08:10:43)
  Copyright (c) 1997-2014 The PHP Group
  Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
  [root@lighttpd ~]# php imaps_php56.php
  Connected to ssl://imap.ikmj.com:993
  * OK ikmj-serwer.home.pl IdeaImapServer v0.80 ready
  1 CAPABILITY
  * CAPABILITY IMAP4rev1 LITERAL+ CHILDREN I18NLEVEL=1 IDLE SORT UIDPLUS
  UNSELECT XLIST AUTH=PLAIN AUTH=LOGIN
  2 LOGOUT

  [root@fpm60 ~]# php -v
  PHP 5.5.23 (cli) (built: Mar 20 2015 08:29:54)
  Copyright (c) 1997-2015 The PHP Group
  Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
      with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend
  Technologies
  [root@fpm60 ~]# php imaps_php56.php
  Connected to ssl://imap.ikmj.com:993
  * OK ikmj-serwer.home.pl IdeaImapServer v0.80 ready
  1 CAPABILITY
  * CAPABILITY IMAP4rev1 LITERAL+ CHILDREN I18NLEVEL=1 IDLE SORT UIDPLUS
  UNSELECT XLIST AUTH=PLAIN AUTH=LOGIN
  2 LOGOUT

  [dev@coreos-control ~]$ php -v
  PHP 5.6.7 (cli) (built: Mar 25 2015 13:08:46) 
  Copyright (c) 1997-2015 The PHP Group
  Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
      with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend 
Technologies
  [dev@coreos-control ~]$ php imaps_php56.php 
  Connected to ssl://imap.ikmj.com:993
  * OK ikmj-serwer.home.pl IdeaImapServer v0.80 ready
  1 CAPABILITY
  ^C
  Hangs until I hit ^C.

  [dev@coreos-control ~]$ php -v
  PHP 5.6.8 (cli) (built: Apr 16 2015 20:02:05) 
  Copyright (c) 1997-2015 The PHP Group
  Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
      with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend 
Technologies
  [dev@coreos-control ~]$ php imaps_php56.php 
  Connected to ssl://imap.ikmj.com:993
  * OK ikmj-serwer.home.pl IdeaImapServer v0.80 ready
  1 CAPABILITY
  ^C
  Hangs until I hit ^C.

  While I first suspected a further case of SSL timeout bug we had in 5.5 and 
5.6 a couple of packages back, I also talked to Remi Collet who reported the 
previous problem to php internals ML and maintains PHP in Fedora. 
  Hi could NOT reproduce it on various PHP & Fedora versions:

  $ php56 /tmp/foo.php
  Running PHP 5.6.8
  Connected to ssl://imap.ikmj.com:993
  * OK ikmj-serwer.home.pl IdeaImapServer v0.80 ready
  1 CAPABILITY
  * CAPABILITY IMAP4rev1 LITERAL+ CHILDREN I18NLEVEL=1 IDLE SORT UIDPLUS
  UNSELECT XLIST AUTH=PLAIN AUTH=LOGIN
  2 LOGOUT

  Hi just run more tests
  - Fedora 21 and openssl 1.0.1k
  - RHEL-6 and RHEL-7, openssl 1.0.1e
  - PHP 5.4.40, 5.5.24, 5.6.8 and 7.0.0-dev (20150418)

  So it appears to me that there must be some difference in patches or
  spec file or IUS and Fedora which causes the problem with IUS PHP 5.6
  packages.

  Ralf

To manage notifications about this bug go to:
https://bugs.launchpad.net/ius/+bug/1446633/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~ius-coredev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ius-coredev
More help   : https://help.launchpad.net/ListHelp

Reply via email to