src/Native/NativeState.php aktualisiert

Fixed problem if you use encrypted SMB connections.

This fix is related to https://github.com/eduardok/libsmbclient-php/issues/101

We use this fix since 2023-06-26 in our nextcloud instance.

Signed-off-by: b3roch <b3roch@noreply.codeberg.org>
This commit is contained in:
b3roch 2025-10-23 13:13:17 +02:00
commit ca8d49e323

View file

@ -108,6 +108,7 @@ class NativeState {
smbclient_option_set($this->state, SMBCLIENT_OPT_AUTO_ANONYMOUS_LOGIN, false); smbclient_option_set($this->state, SMBCLIENT_OPT_AUTO_ANONYMOUS_LOGIN, false);
/** @psalm-suppress UnusedFunctionCall */ /** @psalm-suppress UnusedFunctionCall */
smbclient_option_set($this->state, SMBCLIENT_OPT_TIMEOUT, $options->getTimeout() * 1000); smbclient_option_set($this->state, SMBCLIENT_OPT_TIMEOUT, $options->getTimeout() * 1000);
smbclient_option_set($this->state, SMBCLIENT_OPT_ENCRYPT_LEVEL, SMBCLIENT_ENCRYPTLEVEL_REQUEST); // Request encrypted connection
if (function_exists('smbclient_client_protocols')) { if (function_exists('smbclient_client_protocols')) {
smbclient_client_protocols($this->state, $options->getMinProtocol(), $options->getMaxProtocol()); smbclient_client_protocols($this->state, $options->getMinProtocol(), $options->getMaxProtocol());