Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
ff70c045
Unverified
Commit
ff70c045
authored
Sep 22, 2018
by
Stephan Renatus
Committed by
GitHub
Sep 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1278 from veily/master
Support used self-signed certificates LDAP.
parents
316acbee
317f433a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
ldap.go
connector/ldap/ldap.go
+12
-2
No files found.
connector/ldap/ldap.go
View file @
ff70c045
...
@@ -69,7 +69,10 @@ type Config struct {
...
@@ -69,7 +69,10 @@ type Config struct {
// Path to a trusted root certificate file.
// Path to a trusted root certificate file.
RootCA
string
`json:"rootCA"`
RootCA
string
`json:"rootCA"`
// Path to a client cert file generated by rootCA.
ClientCert
string
`json:"clientCert"`
// Path to a client private key file generated by rootCA.
ClientKey
string
`json:"clientKey"`
// Base64 encoded PEM data containing root CAs.
// Base64 encoded PEM data containing root CAs.
RootCAData
[]
byte
`json:"rootCAData"`
RootCAData
[]
byte
`json:"rootCAData"`
...
@@ -104,7 +107,6 @@ type Config struct {
...
@@ -104,7 +107,6 @@ type Config struct {
IDAttr
string
`json:"idAttr"`
// Defaults to "uid"
IDAttr
string
`json:"idAttr"`
// Defaults to "uid"
EmailAttr
string
`json:"emailAttr"`
// Defaults to "mail"
EmailAttr
string
`json:"emailAttr"`
// Defaults to "mail"
NameAttr
string
`json:"nameAttr"`
// No default.
NameAttr
string
`json:"nameAttr"`
// No default.
}
`json:"userSearch"`
}
`json:"userSearch"`
// Group search configuration.
// Group search configuration.
...
@@ -226,6 +228,14 @@ func (c *Config) openConnector(logger logrus.FieldLogger) (*ldapConnector, error
...
@@ -226,6 +228,14 @@ func (c *Config) openConnector(logger logrus.FieldLogger) (*ldapConnector, error
}
}
tlsConfig
.
RootCAs
=
rootCAs
tlsConfig
.
RootCAs
=
rootCAs
}
}
if
c
.
ClientKey
!=
""
&&
c
.
ClientCert
!=
""
{
cert
,
err
:=
tls
.
LoadX509KeyPair
(
c
.
ClientCert
,
c
.
ClientKey
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"ldap: load client cert failed: %v"
,
err
)
}
tlsConfig
.
Certificates
=
append
(
tlsConfig
.
Certificates
,
cert
)
}
userSearchScope
,
ok
:=
parseScope
(
c
.
UserSearch
.
Scope
)
userSearchScope
,
ok
:=
parseScope
(
c
.
UserSearch
.
Scope
)
if
!
ok
{
if
!
ok
{
return
nil
,
fmt
.
Errorf
(
"userSearch.Scope unknown value %q"
,
c
.
UserSearch
.
Scope
)
return
nil
,
fmt
.
Errorf
(
"userSearch.Scope unknown value %q"
,
c
.
UserSearch
.
Scope
)
...
...
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