mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 00:09:40 +02:00
feat(server): support minimum tls v1.2 (#4076)
This commit is contained in:
parent
227fbeb1b7
commit
8e7aaa23d5
2 changed files with 28 additions and 3 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"time"
|
||||
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
"github.com/portainer/portainer/api/crypto"
|
||||
"github.com/portainer/portainer/api/docker"
|
||||
"github.com/portainer/portainer/api/http/handler"
|
||||
"github.com/portainer/portainer/api/http/handler/auth"
|
||||
|
@ -243,8 +244,14 @@ func (server *Server) Start() error {
|
|||
WebhookHandler: webhookHandler,
|
||||
}
|
||||
|
||||
if server.SSL {
|
||||
return http.ListenAndServeTLS(server.BindAddress, server.SSLCert, server.SSLKey, server.Handler)
|
||||
httpServer := &http.Server{
|
||||
Addr: server.BindAddress,
|
||||
Handler: server.Handler,
|
||||
}
|
||||
return http.ListenAndServe(server.BindAddress, server.Handler)
|
||||
|
||||
if server.SSL {
|
||||
httpServer.TLSConfig = crypto.CreateServerTLSConfiguration()
|
||||
return httpServer.ListenAndServeTLS(server.SSLCert, server.SSLKey)
|
||||
}
|
||||
return httpServer.ListenAndServe()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue