mirror of
https://github.com/harness/drone.git
synced 2025-05-10 02:50:58 +08:00
lets encrypt: migrate to http-01 challenge
This commit is contained in:
parent
5ba8cc3863
commit
32e80eca20
@ -576,11 +576,6 @@ func server(c *cli.Context) error {
|
|||||||
|
|
||||||
// start the server with lets encrypt enabled
|
// start the server with lets encrypt enabled
|
||||||
// listen on ports 443 and 80
|
// listen on ports 443 and 80
|
||||||
g.Go(func() error {
|
|
||||||
return http.ListenAndServe(":http", http.HandlerFunc(redirect))
|
|
||||||
})
|
|
||||||
|
|
||||||
g.Go(func() error {
|
|
||||||
address, err := url.Parse(c.String("server-host"))
|
address, err := url.Parse(c.String("server-host"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -594,6 +589,10 @@ func server(c *cli.Context) error {
|
|||||||
HostPolicy: autocert.HostWhitelist(address.Host),
|
HostPolicy: autocert.HostWhitelist(address.Host),
|
||||||
Cache: autocert.DirCache(dir),
|
Cache: autocert.DirCache(dir),
|
||||||
}
|
}
|
||||||
|
g.Go(func() error {
|
||||||
|
return http.ListenAndServe(":http", manager.HTTPHandler(http.HandlerFunc(redirect)))
|
||||||
|
})
|
||||||
|
g.Go(func() error {
|
||||||
serve := &http.Server{
|
serve := &http.Server{
|
||||||
Addr: ":https",
|
Addr: ":https",
|
||||||
Handler: handler,
|
Handler: handler,
|
||||||
|
Loading…
Reference in New Issue
Block a user