File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ LDAP_GROUP_ATTRIBUTE="memberOf"
7676# Would you like to remove users from roles on BookStack if they do not match on LDAP
7777# If false, the ldap groups-roles sync will only add users to roles
7878LDAP_REMOVE_FROM_GROUPS = false
79+ # Set this option to disable LDAPS Certificate Verification
80+ LDAP_TLS_INSECURE = false
7981
8082# Mail settings
8183MAIL_DRIVER = smtp
Original file line number Diff line number Diff line change @@ -169,8 +169,14 @@ protected function getConnection()
169169 }
170170 $ hostName = $ ldapServer [0 ] . ($ hasProtocol ?': ' :'' ) . $ ldapServer [1 ];
171171 $ defaultPort = $ ldapServer [0 ] === 'ldaps ' ? 636 : 389 ;
172+
172173 $ ldapConnection = $ this ->ldap ->connect ($ hostName , count ($ ldapServer ) > 2 ? intval ($ ldapServer [2 ]) : $ defaultPort );
173174
175+ // Check if TLS_INSECURE is set
176+ if ($ this ->config ['tls_insecure ' ]) {
177+ $ this ->ldap ->setOption ($ ldapConnection , LDAP_OPT_X_TLS_REQUIRE_CERT , LDAP_OPT_X_TLS_NEVER );
178+ }
179+
174180 if ($ ldapConnection === false ) {
175181 throw new LdapException (trans ('errors.ldap_cannot_connect ' ));
176182 }
Original file line number Diff line number Diff line change 148148 'user_to_groups ' => env ('LDAP_USER_TO_GROUPS ' ,false ),
149149 'group_attribute ' => env ('LDAP_GROUP_ATTRIBUTE ' , 'memberOf ' ),
150150 'remove_from_groups ' => env ('LDAP_REMOVE_FROM_GROUPS ' ,false ),
151+ 'tls_insecure ' => env ('LDAP_TLS_INSECURE ' , false ),
151152 ]
152153
153154];
You can’t perform that action at this time.
0 commit comments