[update] add plugin config (#1180)

Signed-off-by: lihaowei <haoweili35@gmail.com>
This commit is contained in:
Howie
2021-10-31 12:56:25 +08:00
committed by GitHub
parent 8230474667
commit cd1f8da13f
4 changed files with 58 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package rest
import (
"crypto/tls"
"log"
"net/http"
@@ -193,6 +194,15 @@ func WithUnauthorizedCallback(callback handler.UnauthorizedCallback) RunOption {
}
}
// WithTLSConfig returns a RunOption that with given tls config.
func WithTLSConfig(cipherSuites []uint16) RunOption {
return func(engine *Server) {
engine.ngin.tlsConfig = &tls.Config{
CipherSuites: cipherSuites,
}
}
}
// WithUnsignedCallback returns a RunOption that with given unsigned callback set.
func WithUnsignedCallback(callback handler.UnsignedCallback) RunOption {
return func(engine *Server) {