mirror of https://github.com/gofiber/fiber.git
parent
769645ac53
commit
3b956ef3a8
6
app.go
6
app.go
|
@ -571,11 +571,11 @@ func (app *App) Listen(addr string) error {
|
|||
// ListenTLS serves HTTPs requests from the given addr.
|
||||
// certFile and keyFile are the paths to TLS certificate and key file.
|
||||
|
||||
// app.Listen(":8080", "./cert.pem", "./cert.key")
|
||||
// app.Listen(":8080", "./cert.pem", "./cert.key")
|
||||
// app.ListenTLS(":8080", "./cert.pem", "./cert.key")
|
||||
// app.ListenTLS(":8080", "./cert.pem", "./cert.key")
|
||||
func (app *App) ListenTLS(addr, certFile, keyFile string) error {
|
||||
// Check for valid cert/key path
|
||||
if len(certFile) == 0 && len(keyFile) == 0 {
|
||||
if len(certFile) == 0 || len(keyFile) == 0 {
|
||||
return errors.New("tls: provide a valid cert or key path")
|
||||
}
|
||||
// Prefork is supported
|
||||
|
|
Loading…
Reference in New Issue