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

Mistake of SNI extention handling #319

Closed
hayden-pan opened this issue Nov 30, 2020 · 3 comments · Fixed by #421
Closed

Mistake of SNI extention handling #319

hayden-pan opened this issue Nov 30, 2020 · 3 comments · Fixed by #421

Comments

@hayden-pan
Copy link

Maybe the code below is getting the server name from wrong place when the dtls server handling SNI extension.
I think the server should get the server name from the state of the connection, which variable name is state in this function scope. Am I right?

dtls/flight4handler.go

Lines 204 to 208 in d01fc85

if cfg.localPSKCallback == nil {
certificate, err := cfg.getCertificate(cfg.serverName)
if err != nil {
return nil, &alert{alertLevelFatal, alertHandshakeFailure}, err
}

@Sean-Der
Copy link
Member

Hey @aaftio sorry I missed this.

I believe you are correct! I think this was broken in 863572a would you be interested in submitting a PR to fix this? It would also be great if you could write a failing test so this doesn't break again.

If you don't have the time to fix this mind just telling me, and I will fix when I get time!

thank you

@hayden-pan
Copy link
Author

@Sean-Der , I am glad to fix it when I get time. Maybe a week later if not in a hurry.

@Sean-Der
Copy link
Member

Sean-Der commented Feb 2, 2021

No hurry at all! Thanks for getting involved :)

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 a pull request may close this issue.

2 participants