diff --git a/engine/engine.go b/engine/engine.go index 5b8e50c9..8aaf6c72 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -199,8 +199,8 @@ type ( Config struct { Address string // TCP address to listen on. Listener net.Listener // Custom `net.Listener`. If set, server accepts connections on it. - TLSCertfile string // TLS certificate file path. - TLSKeyfile string // TLS key file path. + TLSCertFile string // TLS certificate file path. + TLSKeyFile string // TLS key file path. ReadTimeout time.Duration // Maximum duration before timing out read of the request. WriteTimeout time.Duration // Maximum duration before timing out write of the response. } diff --git a/engine/fasthttp/server.go b/engine/fasthttp/server.go index 572c8334..d7264f02 100644 --- a/engine/fasthttp/server.go +++ b/engine/fasthttp/server.go @@ -41,8 +41,8 @@ func New(addr string) *Server { func WithTLS(addr, certFile, keyFile string) *Server { c := engine.Config{ Address: addr, - TLSCertfile: certFile, - TLSKeyfile: keyFile, + TLSCertFile: certFile, + TLSKeyFile: keyFile, } return WithConfig(c) } @@ -111,16 +111,16 @@ func (s *Server) Start() error { func (s *Server) startDefaultListener() error { c := s.config - if c.TLSCertfile != "" && c.TLSKeyfile != "" { - return s.ListenAndServeTLS(c.Address, c.TLSCertfile, c.TLSKeyfile) + if c.TLSCertFile != "" && c.TLSKeyFile != "" { + return s.ListenAndServeTLS(c.Address, c.TLSCertFile, c.TLSKeyFile) } return s.ListenAndServe(c.Address) } func (s *Server) startCustomListener() error { c := s.config - if c.TLSCertfile != "" && c.TLSKeyfile != "" { - return s.ServeTLS(c.Listener, c.TLSCertfile, c.TLSKeyfile) + if c.TLSCertFile != "" && c.TLSKeyFile != "" { + return s.ServeTLS(c.Listener, c.TLSCertFile, c.TLSKeyFile) } return s.Serve(c.Listener) } diff --git a/engine/standard/server.go b/engine/standard/server.go index 60f419bc..c3e56c3c 100644 --- a/engine/standard/server.go +++ b/engine/standard/server.go @@ -39,8 +39,8 @@ func New(addr string) *Server { func WithTLS(addr, certFile, keyFile string) *Server { c := engine.Config{ Address: addr, - TLSCertfile: certFile, - TLSKeyfile: keyFile, + TLSCertFile: certFile, + TLSKeyFile: keyFile, } return WithConfig(c) } @@ -109,8 +109,8 @@ func (s *Server) Start() error { func (s *Server) startDefaultListener() error { c := s.config - if c.TLSCertfile != "" && c.TLSKeyfile != "" { - return s.ListenAndServeTLS(c.TLSCertfile, c.TLSKeyfile) + if c.TLSCertFile != "" && c.TLSKeyFile != "" { + return s.ListenAndServeTLS(c.TLSCertFile, c.TLSKeyFile) } return s.ListenAndServe() } diff --git a/test/server.go b/test/server.go index 5c286b4d..e9458e2d 100644 --- a/test/server.go +++ b/test/server.go @@ -33,8 +33,8 @@ func New(addr string) *Server { func NewTLS(addr, certFile, keyFile string) *Server { c := &engine.Config{ Address: addr, - TLSCertfile: certFile, - TLSKeyfile: keyFile, + TLSCertFile: certFile, + TLSKeyFile: keyFile, } return NewConfig(c) } @@ -84,8 +84,8 @@ func (s *Server) SetLogger(l *log.Logger) { func (s *Server) Start() { s.Addr = s.config.Address s.Handler = s - certFile := s.config.TLSCertfile - keyFile := s.config.TLSKeyfile + certFile := s.config.TLSCertFile + keyFile := s.config.TLSKeyFile if certFile != "" && keyFile != "" { s.logger.Fatal(s.ListenAndServeTLS(certFile, keyFile)) } else {