ldap timeouts not enforced for ldaps protocol
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
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
$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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied PHP script with the nc listener and focus on the ldap_connect, ldap_set_option, and ldap_bind entry points for the ldaps protocol. Trace how LDAP_OPT_NETWORK_TIMEOUT, LDAP_OPT_TIMELIMIT, and LDAP_OPT_TIMEOUT are applied, then verify that the bind exits with a timeout after about 3 seconds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- authentication, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100