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

Partially fix raw IP request regression (#2356) #2367

Closed
wants to merge 1 commit into from

Conversation

Zenexer
Copy link

@Zenexer Zenexer commented Nov 24, 2018

1. What does this change do, exactly?

Partially resolves regression that resulted from a security patch, as described in #2356

2. Please link to the relevant issues.

#2356

3. Which documentation changes (if any) need to be made because of this PR?

This still needs to be discussed.

4. Checklist

  • I have written tests and verified that they fail without my change
  • I have squashed any insignificant commits
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I am willing to help maintain this change if there are issues with it later

@CLAassistant
Copy link

CLAassistant commented Nov 24, 2018

CLA assistant check
All committers have signed the CLA.

@Zenexer
Copy link
Author

Zenexer commented Nov 24, 2018

I did my best to minimize the potential for unintended side effects. Initially, I tried to get it to intelligently fall back to the most likely intended certificate under certain circumstances, but the changes were too disruptive, and I couldn't easily gauge the fallout.

@Zenexer
Copy link
Author

Zenexer commented Nov 24, 2018

Force-pushed formatting adjustment for handshake_test.go (gofmt -s)

@jung-kurt
Copy link

Nice work, @Zenexer. Thanks for your prompt attention to this issue. Your solution addresses some subtleties that I would have certainly missed. My simple example and my more complicated working setup both work properly with your changes.

@francislavoie francislavoie requested a review from mholt November 25, 2018 19:43
@lukenowak
Copy link

Thank you @Zenexer , I checked your PR code and it works perfectly on my quite complex configuration (a lot of sites with many name-based certificates and few endpoints with IP based -- IPv4, IPv6 and others).

For the ip access I have caddyfile like:

https:[::1]:5555, https:127.0.0.1:5555 {
  bind 127.0.0.1
  tls ip.crt ip.key
}

And my cert has two IPs in altSubjectName with meaningless common name. All works well.

Of course! If at least one entry for IP-based access has wrong certificate, like adding to my Caddyfile:

https:[::1]:5555/cous, https:127.0.0.1:5555/cous {
  bind 127.0.0.1
  tls other.crt other.key
}

all endpoints returns error.

This is expected, as it is said in the docs, that all configurations shall share exactly the same TLS stanzas. Improving error reporting in this case is subject to another thing I think.

@mholt
Copy link
Member

mholt commented Dec 12, 2018

Thank you for your pull request. This is a good change, and I would like to see it make its way into Caddy.

Unfortunately, the handshake logic has moved to CertMagic. If you could migrate the relevant changes in this pull request in that repo (linking to the same issues over in this repo), that would be appreciated, and I'll get it reviewed and merged in.

Then update this PR with the Caddy-specific changes and I'll merge this in after that new one.

@Zenexer
Copy link
Author

Zenexer commented Dec 14, 2018

Will do ASAP.

@mholt Apologies for bringing this here, but I want to be absolutely sure I get this message to you. I received a suspicious message claiming to be from you. I've sent you more info via Keybase chat. Looks like you might not actively use Keybase, so I'll follow up via email.

@mholt
Copy link
Member

mholt commented Dec 14, 2018

@Zenexer Thanks! Also, I got your email. Am swamped today but will take care of it.

@mholt mholt added the help wanted 🆘 Extra attention is needed label Jan 17, 2019
@mholt
Copy link
Member

mholt commented Jan 22, 2019

Mostly superseded by a7aeb97 - but I would like to at least merge in your tests, @Zenexer, either here or CertMagic, wherever they belong.

@mholt mholt closed this Feb 5, 2019
@mholt mholt removed the help wanted 🆘 Extra attention is needed label Feb 5, 2019
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.

5 participants