Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • S Snowflake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 90
    • Issues 90
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 6
    • Merge requests 6
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Anti-censorship
  • Pluggable Transports
  • Snowflake
  • Issues
  • #40224
Closed
Open
Issue created Oct 21, 2022 by David Fifield@dcfOwner

utls RoundTripper does not work when it is supposed to use HTTP/1

Try setting utls=hellorandomizednoalpn in the bridge line. snowflake-client's rendezvous will fail with:

WebRTC: incorrect ALPN negotiated  Retrying...

Lack of ALPN should cause a fallback to HTTP/1, and the connection should still work. What's going wrong.

The problem is the internal connectWithH1 map, which is inconsistently keyed. Entries are written to the map with host:port keys. Entries are read from the map using sometimes host:port keys, and sometimes host keys.

  • RoundTrip calls gets its domain name from req.URL.Host; i.e., it uses a key like "cdn.sstatic.net".
  • dialOrGetTLSWithExpectedALPN gets its domain name from an addr argument to DialTLS; i.e., it uses a key like "cdn.sstatic.net:443".

Adding a few debugging logs makes it clear what is going wrong:

2022/10/21 23:26:48 Target URL:  snowflake-broker.torproject.net.global.prod.fastly.net
2022/10/21 23:26:48 Front URL:   cdn.sstatic.net
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net") -> false
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net:443") -> false
2022/10/21 23:26:48 setShouldConnectWithH1("cdn.sstatic.net:443")
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net") -> false
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net:443") -> true
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net") -> false
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net:443") -> true
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net") -> false
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net:443") -> true
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net") -> false
2022/10/21 23:26:48 getShouldConnectWithH1("cdn.sstatic.net:443") -> true
2022/10/21 23:26:48 WebRTC: closing DataChannel
2022/10/21 23:26:48 WebRTC: closing PeerConnection
2022/10/21 23:26:48 WebRTC: Closing
2022/10/21 23:26:48 WebRTC: incorrect ALPN negotiated  Retrying...
Assignee
Assign to
Time tracking