Certificate can contain path or file contents
Signed-off-by: Martin <martin.piegay@zenika.com>
This commit is contained in:
parent
056e0fe2d9
commit
7ada80b619
5 changed files with 172 additions and 14 deletions
11
server.go
11
server.go
|
@ -290,14 +290,9 @@ func (server *Server) createTLSConfig(entryPointName string, tlsOption *TLS, rou
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
config := &tls.Config{}
|
||||
config.Certificates = []tls.Certificate{}
|
||||
for _, v := range tlsOption.Certificates {
|
||||
cert, err := tls.LoadX509KeyPair(v.CertFile, v.KeyFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
config.Certificates = append(config.Certificates, cert)
|
||||
config, err := tlsOption.Certificates.CreateTLSConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(tlsOption.ClientCAFiles) > 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue