Skip to content

ldap timeouts not enforced for ldaps protocol #9320

Open
@trtan

Description

@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
$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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions