mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
security: disallow tls1.0/1.1
This commit is contained in:
parent
99e975145c
commit
453262832a
1 changed files with 2 additions and 1 deletions
|
@ -73,6 +73,7 @@ func NewServer(opt Options) (s *Server) {
|
||||||
Handler: opt.Handler,
|
Handler: opt.Handler,
|
||||||
TLSConfig: &tls.Config{
|
TLSConfig: &tls.Config{
|
||||||
GetCertificate: opt.CertProvider.GetCert,
|
GetCertificate: opt.CertProvider.GetCert,
|
||||||
|
MinVersion: tls.VersionTLS12,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,7 +170,7 @@ func stop[Server httpServer](srv Server, logger *zerolog.Logger) {
|
||||||
|
|
||||||
proto := proto(srv)
|
proto := proto(srv)
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(task.RootContext(), 3*time.Second)
|
ctx, cancel := context.WithTimeout(task.RootContext(), 1*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
if err := srv.Shutdown(ctx); err != nil {
|
if err := srv.Shutdown(ctx); err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue