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

added sni tests #3146

Merged
merged 4 commits into from Mar 17, 2020
Merged

added sni tests #3146

merged 4 commits into from Mar 17, 2020

Conversation

sarge
Copy link
Collaborator

@sarge sarge commented Mar 14, 2020

Expanding the SNI tests.

Ideally with an SNI less connection we don't to know the destination IP address, things in the cloud are load balanced, DNS changes.

This change supports this port only matching configuration

 {
    http_port     9080
    https_port    9443
    default_sni   a.caddy.localhost
  }

:9443 {
    tls /a.caddy.localhost.crt /a.caddy.localhost.key {
    }
    respond /version 200 {
      body "hello from a.caddy.localhost"
    }	
}

The configuration I would like to support is

 {
    http_port     9080
    https_port    9443
    default_sni   a.caddy.localhost
  }

 a.caddy.localhost:9443 {
    tls /a.caddy.localhost.crt /a.caddy.localhost.key {
    }
    respond /version 200 {
      body "hello from a.caddy.localhost"
    }	
  }

Which would respond to curl https://127.0.0.1/version. In this case the CP matches perfectly but the host matcher does not.

I guess an alternative could be, with a wildcard IP matcher.

 a.caddy.localhost:9443, 0.0.0.0:9443 {
    tls /a.caddy.localhost.crt /a.caddy.localhost.key {
    }
    respond /version 200 {
      body "hello from a.caddy.localhost"
    }	
  }

@mholt
Copy link
Member

mholt commented Mar 16, 2020

Cool, so should we merge this?

@mholt mholt merged commit 3f48a2e into caddyserver:v2 Mar 17, 2020
@mholt mholt added this to the v2.0.0-beta.18 milestone Mar 17, 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