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
This commit is contained in:
kataras 2017-08-26 01:33:55 +03:00
parent 83fbef2d2f
commit f7b655f145
3 changed files with 4 additions and 4 deletions

View File

@ -137,7 +137,7 @@ $ go run main.go
Go 1.9 just released. 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. 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.

View File

@ -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. // 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 // 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. // http versions to their https as well.
func (su *Supervisor) ListenAndServeAutoTLS(domain string, email string, cacheDir string) error { func (su *Supervisor) ListenAndServeAutoTLS(domain string, email string, cacheDir string) error {
var ( var (
@ -335,7 +335,6 @@ func (su *Supervisor) ListenAndServeAutoTLS(domain string, email string, cacheDi
redirectSrv := NewRedirection(":80", target, -1) redirectSrv := NewRedirection(":80", target, -1)
// register a shutdown callback to this // register a shutdown callback to this
// supervisor in order to close the "secondary redirect server" as well. // supervisor in order to close the "secondary redirect server" as well.
su.RegisterOnShutdown(func() { su.RegisterOnShutdown(func() {
// give it some time to close itself... // give it some time to close itself...
timeout := 5 * time.Second timeout := 5 * time.Second
@ -343,6 +342,7 @@ func (su *Supervisor) ListenAndServeAutoTLS(domain string, email string, cacheDi
defer cancel() defer cancel()
redirectSrv.Shutdown(ctx) redirectSrv.Shutdown(ctx)
}) })
// start that redirect server using a different goroutine. // start that redirect server using a different goroutine.
go redirectSrv.ListenAndServe() go redirectSrv.ListenAndServe()
} }

View File

@ -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. // 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 // 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. // http versions to their https as well.
// //
// Last argument is optional, it accepts one or more // Last argument is optional, it accepts one or more