Skip to content

Commit 748132d

Browse files
Merge branch '6.0' into 6.1
* 6.0: [Console] Fixes "Incorrectly nested style tag found" error when using multi-line header content Fix LDAP connection options fix probably undefined variable $expireAt Fix aliases handling in command name completion Fix division by zero Allow ErrorHandler ^5.0 to be used in HttpKernel [Security/Http] Ignore invalid URLs found in failure/success paths Fix typo
2 parents 2dc2423 + 65f08dd commit 748132d

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Adapter/ExtLdap/Connection.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ class Connection extends AbstractConnection
2929
private const LDAP_INVALID_CREDENTIALS = 0x31;
3030
private const LDAP_TIMEOUT = 0x55;
3131
private const LDAP_ALREADY_EXISTS = 0x44;
32+
private const PRECONNECT_OPTIONS = [
33+
ConnectionOptions::DEBUG_LEVEL,
34+
ConnectionOptions::X_TLS_CACERTDIR,
35+
ConnectionOptions::X_TLS_CACERTFILE,
36+
ConnectionOptions::X_TLS_REQUIRE_CERT,
37+
];
3238

3339
private bool $bound = false;
3440

@@ -143,10 +149,18 @@ private function connect()
143149
return;
144150
}
145151

152+
foreach ($this->config['options'] as $name => $value) {
153+
if (\in_array(ConnectionOptions::getOption($name), self::PRECONNECT_OPTIONS, true)) {
154+
$this->setOption($name, $value);
155+
}
156+
}
157+
146158
$this->connection = ldap_connect($this->config['connection_string']);
147159

148160
foreach ($this->config['options'] as $name => $value) {
149-
$this->setOption($name, $value);
161+
if (!\in_array(ConnectionOptions::getOption($name), self::PRECONNECT_OPTIONS, true)) {
162+
$this->setOption($name, $value);
163+
}
150164
}
151165

152166
if (false === $this->connection) {

Adapter/ExtLdap/ConnectionOptions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ final class ConnectionOptions
4040
public const DEBUG_LEVEL = 0x5001;
4141
public const TIMEOUT = 0x5002;
4242
public const NETWORK_TIMEOUT = 0x5005;
43+
public const X_TLS_CACERTFILE = 0x6002;
4344
public const X_TLS_CACERTDIR = 0x6003;
4445
public const X_TLS_CERTFILE = 0x6004;
4546
public const X_TLS_CRL_ALL = 0x02;

0 commit comments

Comments
 (0)