Skip to content

Commit

Permalink
make tls-alpn mokeVA send appropeate SNI(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
orangepizza authored and ldez committed Apr 23, 2023
1 parent 46299b5 commit 863e56b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions challenge/tlsalpn01/tls_alpn_challenge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/go-acme/lego/v4/acme/api"
"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/platform/tester"
"github.com/miekg/dns"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand All @@ -27,6 +28,7 @@ func TestChallenge(t *testing.T) {

mockValidate := func(_ *api.Core, _ string, chlng acme.Challenge) error {
conn, err := tls.Dial("tcp", net.JoinHostPort(domain, port), &tls.Config{
ServerName: domain,
InsecureSkipVerify: true,
})
require.NoError(t, err, "Expected to connect to challenge server without an error")
Expand Down Expand Up @@ -125,9 +127,11 @@ func TestChallengeIPaddress(t *testing.T) {

domain := "127.0.0.1"
port := "23457"
rd, _ := dns.ReverseAddr(domain)

mockValidate := func(_ *api.Core, _ string, chlng acme.Challenge) error {
conn, err := tls.Dial("tcp", net.JoinHostPort(domain, port), &tls.Config{
ServerName: rd,
InsecureSkipVerify: true,
})
require.NoError(t, err, "Expected to connect to challenge server without an error")
Expand Down

0 comments on commit 863e56b

Please sign in to comment.