[php-src] Issue #9320: ldap timeouts not enforced for ldaps protocol

From: Date: Fri, 12 Aug 2022 17:12:16 +0000
Subject: [php-src] Issue #9320: ldap timeouts not enforced for ldaps protocol
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-242206@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/9320
Author: trtan

### Description

According to site: https://bugs.php.net/bug.php?id=69574
I added LDAP_OPT_TIMEOUT to enforce bind operation time out. This worked for ldap protocol. But not
for ldaps protocol. 
steps to reproduce:

In one ssh session, I am running the following command to simulate a socket listener:
nc -l 636

And run following code:

```php
<?php
$ldap = ldap_connect('ldaps://127.0.0.1:636');

ldap_set_option($ldap, LDAP_OPT_NETWORK_TIMEOUT, 3);
ldap_set_option($ldap, LDAP_OPT_TIMELIMIT, 3);
ldap_set_option($ldap, LDAP_OPT_TIMEOUT, 3);

ldap_bind($ldap);
?>
```

Resulted in this output:
```
This never times out
```

But I expected this output instead:
```
times out in 3 seconds. 
```


### PHP Version

PHP 7.4.30

### Operating System

Windows 10


Thread (1 message)

  • trtan
« previous php.bugs (#242206) next »