Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
b1060180
Unverified
Commit
b1060180
authored
Jan 31, 2021
by
Kevyn Bruyere
Committed by
GitHub
Jan 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: LDAP - avoid reading empty tls cert file (#2980)
Co-authored-by:
Kevyn Bruyere
<
kevyn@inovasi.fr
>
parent
cfbd3dca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
authentication.js
server/modules/authentication/ldap/authentication.js
+23
-6
No files found.
server/modules/authentication/ldap/authentication.js
View file @
b1060180
...
...
@@ -18,12 +18,7 @@ module.exports = {
bindCredentials
:
conf
.
bindCredentials
,
searchBase
:
conf
.
searchBase
,
searchFilter
:
conf
.
searchFilter
,
tlsOptions
:
(
conf
.
tlsEnabled
)
?
{
rejectUnauthorized
:
conf
.
verifyTLSCertificate
,
ca
:
[
fs
.
readFileSync
(
conf
.
tlsCertPath
)
]
}
:
{},
tlsOptions
:
getTlsOptions
(
conf
),
includeRaw
:
true
},
usernameField
:
'email'
,
...
...
@@ -56,3 +51,25 @@ module.exports = {
))
}
}
function
getTlsOptions
(
conf
)
{
if
(
!
conf
.
tlsEnabled
)
{
return
{}
}
if
(
!
conf
.
tlsCertPath
)
{
return
{
rejectUnauthorized
:
conf
.
verifyTLSCertificate
,
}
}
const
caList
=
[]
if
(
conf
.
verifyTLSCertificate
)
{
caList
.
push
(
fs
.
readFileSync
(
conf
.
tlsCertPath
))
}
return
{
rejectUnauthorized
:
conf
.
verifyTLSCertificate
,
ca
:
caList
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment