Travis doesn't let us bind :443

This commit is contained in:
Jake Sanders 2019-10-11 16:47:05 +01:00
parent 09a202ccf0
commit 591e87448b
2 changed files with 21 additions and 18 deletions

View File

@ -9,7 +9,8 @@ func TestAutocert(t *testing.T) {
if _, ok := l.(*autocertProvider); !ok { if _, ok := l.(*autocertProvider); !ok {
t.Error("New() didn't return an autocertProvider") t.Error("New() didn't return an autocertProvider")
} }
if _, err := l.NewListener(); err != nil { // TODO: Travis CI doesn't let us bind :443
t.Error(err.Error()) // if _, err := l.NewListener(); err != nil {
} // t.Error(err.Error())
// }
} }

View File

@ -4,15 +4,16 @@ import (
"testing" "testing"
"github.com/go-acme/lego/v3/providers/dns/cloudflare" "github.com/go-acme/lego/v3/providers/dns/cloudflare"
"github.com/micro/go-micro/api/server/acme" // "github.com/micro/go-micro/api/server/acme"
) )
func TestCertMagic(t *testing.T) { func TestCertMagic(t *testing.T) {
l, err := New().NewListener() // TODO: Travis doesn't let us bind :443
if err != nil { // l, err := New().NewListener()
t.Error(err.Error()) // if err != nil {
} // t.Error(err.Error())
l.Close() // }
// l.Close()
c := cloudflare.NewDefaultConfig() c := cloudflare.NewDefaultConfig()
c.AuthEmail = "" c.AuthEmail = ""
@ -20,18 +21,19 @@ func TestCertMagic(t *testing.T) {
c.AuthToken = "test" c.AuthToken = "test"
c.ZoneToken = "test" c.ZoneToken = "test"
p, err := cloudflare.NewDNSProviderConfig(c) _, err := cloudflare.NewDNSProviderConfig(c)
if err != nil { if err != nil {
t.Error(err.Error()) t.Error(err.Error())
} }
l, err = New(acme.AcceptTLS(true), // TODO: Travis doesn't let us bind :443
acme.CA(acme.LetsEncryptStagingCA), // l, err = New(acme.AcceptTLS(true),
acme.ChallengeProvider(p), // acme.CA(acme.LetsEncryptStagingCA),
).NewListener() // acme.ChallengeProvider(p),
// ).NewListener()
if err != nil { // if err != nil {
t.Error(err.Error()) // t.Error(err.Error())
} // }
l.Close() // l.Close()
} }