mirror of
https://github.com/kataras/iris.git
synced 2025-03-14 08:26:26 +01:00
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:
parent
83fbef2d2f
commit
f7b655f145
|
@ -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.
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
2
iris.go
2
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user