lets-go:10.5 tls config
This commit is contained in:
parent
f284b18ee4
commit
5d582a5971
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/tls"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"flag"
|
"flag"
|
||||||
"html/template"
|
"html/template"
|
||||||
@ -67,10 +68,15 @@ func main() {
|
|||||||
sessionManager: sessionManager,
|
sessionManager: sessionManager,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tlsConfig := &tls.Config{
|
||||||
|
CurvePreferences: []tls.CurveID{tls.X25519, tls.CurveP256},
|
||||||
|
}
|
||||||
|
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
Addr: *addr,
|
Addr: *addr,
|
||||||
Handler: app.routes(),
|
Handler: app.routes(),
|
||||||
ErrorLog: slog.NewLogLogger(logger.Handler(), slog.LevelError),
|
ErrorLog: slog.NewLogLogger(logger.Handler(), slog.LevelError),
|
||||||
|
TLSConfig: tlsConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Info("starting server", slog.String("addr", srv.Addr))
|
logger.Info("starting server", slog.String("addr", srv.Addr))
|
||||||
|
Loading…
Reference in New Issue
Block a user