mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
Error for non 443 port for auto tls
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
900a463715
commit
7025f55cab
10
echo.go
10
echo.go
@ -546,8 +546,16 @@ func (e *Echo) StartTLS(address string, certFile, keyFile string) (err error) {
|
||||
return e.startTLS(address)
|
||||
}
|
||||
|
||||
// StartAutoTLS starts an HTTPS server using certificates automatically from https://letsencrypt.org.
|
||||
// StartAutoTLS starts an HTTPS server using certificates automatically installed from https://letsencrypt.org.
|
||||
// Port in address must be 443.
|
||||
func (e *Echo) StartAutoTLS(address string) error {
|
||||
_, port, err := net.SplitHostPort(address)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if port != "443" {
|
||||
return errors.New("port for auto tls must be 443")
|
||||
}
|
||||
s := e.TLSServer
|
||||
s.TLSConfig = new(tls.Config)
|
||||
s.TLSConfig.GetCertificate = e.AutoTLSManager.GetCertificate
|
||||
|
@ -39,9 +39,9 @@ type (
|
||||
// - latency_human (Human readable)
|
||||
// - bytes_in (Bytes received)
|
||||
// - bytes_out (Bytes sent)
|
||||
// - header:<name>
|
||||
// - query:<name>
|
||||
// - form:<name>
|
||||
// - header:<NAME>
|
||||
// - query:<NAME>
|
||||
// - form:<NAME>
|
||||
//
|
||||
// Example "${remote_ip} ${status}"
|
||||
//
|
||||
|
@ -64,9 +64,9 @@ LoggerConfig struct {
|
||||
// - latency_human (Human readable)
|
||||
// - bytes_in (Bytes received)
|
||||
// - bytes_out (Bytes sent)
|
||||
// - header:<name>
|
||||
// - query:<name>
|
||||
// - form:<name>
|
||||
// - header:<NAME>
|
||||
// - query:<NAME>
|
||||
// - form:<NAME>
|
||||
//
|
||||
// Example "${remote_ip} ${status}"
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user