File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -686,6 +686,24 @@ private function doConnect($host, $port): bool {
686686 $ this ->ldap ->setOption (null , LDAP_OPT_X_TLS_REQUIRE_CERT , LDAP_OPT_X_TLS_DEMAND );
687687 }
688688
689+ $ absoluteBundlePath = \OCP \ICertificateManager::getAbsoluteBundlePath;
690+ $ defaultCertificatePath = \OCP \ICertificateManager::getDefaultCertificatesBundlePath;
691+ // We check if default certificate path is actually set to a custom value.
692+ // Otherwise this would be a breaking change and cannot be backported.
693+ if (!empty ($ defaultCertificatePath ) && $ defaultCertificatePath !== \OC ::$ SERVERROOT . '/resources/config/ca-bundle.crt ' ) {
694+ if ($ this ->ldap ->setOption (null , LDAP_OPT_X_TLS_CACERTFILE , $ absoluteBundlePath )) {
695+ $ this ->logger ->debug (
696+ 'Adjusted the tls certificate file path to ' . $ absoluteBundlePath ,
697+ ['app ' => 'user_ldap ' ]
698+ );
699+ } else {
700+ $ this ->logger ->warning (
701+ 'Could not change the tls certificate file path. ' ,
702+ ['app ' => 'user_ldap ' ]
703+ );
704+ }
705+ }
706+
689707 $ this ->ldapConnectionRes = $ this ->ldap ->connect ($ host , $ port ) ?: null ;
690708
691709 if ($ this ->ldapConnectionRes === null ) {
You can’t perform that action at this time.
0 commit comments