Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default sni #3141

Merged
merged 6 commits into from Mar 13, 2020
Merged

Fix default sni #3141

merged 6 commits into from Mar 13, 2020

Conversation

sarge
Copy link
Collaborator

@sarge sarge commented Mar 13, 2020

When requesting without SNI, the default connection policy needs to know to use the fallback certificate.

// arrange
caddytest.InitServer(t, ` 
  {
    http_port     9080
    https_port    9443
    default_sni   *.caddy.localhost
  }
  
  127.0.0.1:9443 {
    tls /caddy.localhost.crt /caddy.localhost.key {
    }
    respond /version 200 {
      body "hello from a.caddy.localhost"
    }	
  }
  `, "caddyfile")

	// act and assert
	caddytest.AssertGetResponse(t, "https://127.0.0.1:9443/version", 200, "hello from a.caddy.localhost")

@mholt
Copy link
Member

mholt commented Mar 13, 2020

Going to try to re-jigger the CI to attach, but I doubt it'll work...

Edit: Nope, ha...

@mholt mholt closed this Mar 13, 2020
@mholt mholt reopened this Mar 13, 2020
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In lieu of missing CI attachments, I cloned this locally and ran the tests, and it LGTM!

Thanks @sarge !

@mholt mholt added the v2 label Mar 13, 2020
@mholt mholt added this to the v2.0.0-beta.16 milestone Mar 13, 2020
@mholt mholt merged commit c447236 into caddyserver:v2 Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants