From f7b655f145b011e758cf06fb8adef871d9c18fde Mon Sep 17 00:00:00 2001 From: kataras Date: Sat, 26 Aug 2017 01:33:55 +0300 Subject: [PATCH] Happy weekend! Due the latest news we have a single change for your own safety. `iris.AutoTLS` users should pass all the necessary information now, these are the recommended by letsencrypt. Iris devs should declare all the information now, there is no option to "leave something out" anymore, it's for your own good. Version is not changed yet, giving you time to see that changelog and do the necessary changes to your codebase, it will written to HISTORY.md too of course. Before: app.Run(iris.AutoTLS(":443")) Now: app.Run(iris.AutoTLS(":443", "example.com", "mail@example.com") Happy weekend! Former-commit-id: f5314a8c1f8303d7216481d05129eb8a62766e14 --- README.md | 2 +- core/host/supervisor.go | 4 ++-- iris.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 09099e13..681db223 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ $ go run main.go Go 1.9 just released. -Dcumentation and examples will be updated soon to use the already-type aliases inside the framework, such as `iris.Context` instead of the origin pacage. +Dcumentation and examples will be updated soon to use the already-type aliases inside the framework, such as `iris.Context` instead of the origin package. If you've installed [Go 1.9](https://golang.org/dl) then you can omit the `github.com/kataras/iris/context` package from the imports statement. diff --git a/core/host/supervisor.go b/core/host/supervisor.go index bad6599f..ff526cb5 100644 --- a/core/host/supervisor.go +++ b/core/host/supervisor.go @@ -281,7 +281,7 @@ func (su *Supervisor) ListenAndServeTLS(certFile string, keyFile string) error { // If empty, certs will only be cached for the lifetime of the auto tls manager. // // Note: If domain is not empty and the server's port was "443" then -// it will start a new server, automaticall for you, which will redirect all +// it will start a new server, automatically for you, which will redirect all // http versions to their https as well. func (su *Supervisor) ListenAndServeAutoTLS(domain string, email string, cacheDir string) error { var ( @@ -335,7 +335,6 @@ func (su *Supervisor) ListenAndServeAutoTLS(domain string, email string, cacheDi redirectSrv := NewRedirection(":80", target, -1) // register a shutdown callback to this // supervisor in order to close the "secondary redirect server" as well. - su.RegisterOnShutdown(func() { // give it some time to close itself... timeout := 5 * time.Second @@ -343,6 +342,7 @@ func (su *Supervisor) ListenAndServeAutoTLS(domain string, email string, cacheDi defer cancel() redirectSrv.Shutdown(ctx) }) + // start that redirect server using a different goroutine. go redirectSrv.ListenAndServe() } diff --git a/iris.go b/iris.go index d9870401..ea53e86e 100644 --- a/iris.go +++ b/iris.go @@ -566,7 +566,7 @@ func TLS(addr string, certFile, keyFile string, hostConfigs ...host.Configurator // For an "e-mail" use a non-public one, letsencrypt needs that for your own security. // // Note: If domain is not empty and the server's port was "443" then -// it will start a new server, automaticall for you, which will redirect all +// it will start a new server, automatically for you, which will redirect all // http versions to their https as well. // // Last argument is optional, it accepts one or more