Skip to content

Mistake of SNI extention handling #319

Closed

Description

@haipengpan

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
}

Activity

  1. Sean-Der commented on Jan 18, 2021

    @Sean-Der
    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

  2. haipengpan commented on Jan 29, 2021

    @haipengpan
    Author

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

  3. Sean-Der commented on Feb 2, 2021

    @Sean-Der
    Member

    No hurry at all! Thanks for getting involved :)

  4. added 3 commits that reference this issue on Jan 28, 2022
    52cb820
    376d08e
    61e85e8
  5. added a commit that references this issue on Jan 29, 2022
    cd49492
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址