6.0.0-alpha12
6/12/25

[#14206] TLS no longer works with self-signed certificates
Summary TLS no longer works with self-signed certificates
Queue Ingo
Queue Version Git master
Type Enhancement
State Resolved
Priority 1. Low
Owners
Requester aaronp (at) critd (dot) com
Created 12/18/2015 (3464 days ago)
Due
Updated 01/06/2016 (3445 days ago)
Assigned
Resolved 12/29/2015 (3453 days ago)
Milestone
Patch No

History
01/06/2016 07:16:24 AM Jan Schneider Comment #9 Reply to this comment
I assume the git version is working towards a new major release of 
Ingo, say 3.3 or 4.0.
Correct.
Maybe this change can be added to a future Ingo 3.2.6 minor release?
No, because that would require major changes within the 3rd-party 
Net_Socket and Net_Sieve libraries which are both unmaintained.
01/04/2016 04:47:55 PM aaronp (at) critd (dot) com Comment #8 Reply to this comment
Ah yes, it seems I did. I'm using the latest release versions of Horde 
and Ingo, which at this time seem to be Horde 5.2.8 and Ingo 3.2.5. 
This ticket may need to be changed to reflect that.

I assume the git version is working towards a new major release of 
Ingo, say 3.3 or 4.0. Maybe this change can be added to a future Ingo 
3.2.6 minor release? Should I submit a separate bug report or 
enhancement request?

Thanks so much for the great software and your help troubleshooting!
01/04/2016 03:45:18 PM Jan Schneider Comment #7 Reply to this comment
You have reported this against the Git master version of Ingo that 
indeed does use \Socket\Client instead of Net_Sieve.
01/04/2016 03:32:36 PM aaronp (at) critd (dot) com Comment #6 Reply to this comment
Sorry, but I need to open this ticket again. I was not testing 
correctly, and it turns out the problem was still happening.

After more research and adding a little debug in 
Horde/Socket/Client.php, I discovered that my problem is that 
startTls() never gets called when making a sieve connection in Ingo. I 
then discovered that, of course, Ingo is actually using Net_Sieve to 
connect and not Horde_Socket_Client. I then started passing the same 
verify_peer and verify_peer_name TLS options, and now TLS works with 
Ingo. Here is a clip from my lib/Transport/Timsieved.php starting at 
line 60:

<SNIP>
     protected function _connect()
     {
         if (!empty($this->_sieve)) {
             return;
         }

         $options = array(
             'ssl' => array(
                 'verify_peer' => false,
                 'verify_peer_name' => false
             )
         );

         $auth = empty($this->_params['admin'])
             ? $this->_params['username']
             : $this->_params['admin'];

         $this->_sieve = new Net_Sieve(
             $auth,
             $this->_params['password'],
             $this->_params['hostspec'],
             $this->_params['port'],
             $this->_params['logintype'],
             $this->_params['euser'],
             $this->_params['debug'],
             false,
             $this->_params['usetls'],
             $options,
             array($this, 'debug')
         );
</SNIP>

This was quick and dirty. Maybe you would prefer to pass this kind of 
thing through the constructor? Either way, I think this or something 
similar should be added for the next release. Thanks!
12/29/2015 07:07:02 PM Jan Schneider State ⇒ Resolved
 
12/29/2015 04:49:16 PM aaronp (at) critd (dot) com Comment #5 Reply to this comment
The patch worked for me! I'll assume it will be a part of the next 
major release, whenever that will be. This ticket can be closed now. 
Thanks!
12/29/2015 04:23:02 PM aaronp (at) critd (dot) com Comment #3 Reply to this comment
Interesting. I see that verification is indeed being turned off in my 
Socket/Client.php. Regardless, my Ingo/Sieve works with 'usetls' => 
false, but not with either 'usetls' => 'tls', or  'usetls' => true. 
Here's what I get in the horde.log file:

Dec 29 10:14:55 hostname HORDE: [ingo] PHP ERROR: 
stream_socket_enable_crypto(): SSL operation failed with code 1. 
OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate 
verify failed [pid 11811 on line 1215 of 
"/usr/local/lib/php/Net/Sieve.php"]


Is it trying to use SSL3? I do not support SSL3 on my Cyrus server. Only TLS.


12/28/2015 03:29:42 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
We already disable peer verification to keep backward compatibility 
across PHP versions. See 
https://github.com/horde/horde/blob/master/framework/Socket_Client/lib/Horde/Socket/Client.php#L97
12/18/2015 03:28:41 PM aaronp (at) critd (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ TLS no longer works with self-signed certificates
Queue ⇒ Ingo
Milestone ⇒
Patch ⇒ No
State ⇒ New
Reply to this comment
Possibly related to changes made in 5.6:
http://php.net/manual/en/migration56.openssl.php

I need a way to tell Ingo and the other apps that I prefer that they 
not validate TLS certificates. The old Horde 3.3 apps used to allow a 
/novalidate-cert syntax. Something similar would be ideal.

Saved Queries