Skip to content
Snippets Groups Projects
  1. Jan 11, 2019
    • David Fifield's avatar
      Use the utls HelloRandomizedNoALPN handshake. · 90d82c20
      David Fifield authored
      Since we cannot use any handshake that has a "h2" ALPN (like
      HelloFirefox_63 or HelloChrome_70), let's use a randomized handshake.
      HelloRandomizedNoALPN differs from HelloRandomized and
      HelloRandomizedALPN in that it always omits ALPN.
      
      The http.Transport still appears to make 10 independent connections,
      each with its own randomized fingerprint...
      90d82c20
  2. Jan 02, 2019
    • David Fifield's avatar
      First try at utls integration. · 5a98c444
      David Fifield authored
      Disables proxy support: I'm using http.Transport.DialTLS to hook into
      utls, and http.Transport.Proxy is ignored when DialTLS is set. We'll
      have to manually make our own proxy connections within DialTLS.
      
      It doesn't work properly yet because the HelloChrome_Auto fingerprint
      we're using includes "h2" in the ALPN extension, which causes the server
      to think it should use HTTP/2. The client side, however, uses HTTP/1.1
      because it disable automatic HTTP/2 configuration when DialTLS is set.
      So you have an HTTP/1.1 client talking to an HTTP/2 server, and an error
      message like this:
      	error in handling request: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x00\x00\x12\x04\x00\x00\x00\x00\x00\x00\x05\x00\x10\x00\x00\x00\x03\x00\x00\x00\xfa\x00\x06\x00\x10\x01@"
      
      As a workaround, I'm not calling UConn.Handshake() before returning the
      UConn from DialTLS. This seems to cause the caller to remove the ALPN
      extension, thereby negotiating HTTP/1.1 on both sides. The downside are
      the loss of HTTP/2, and the fact that a missing ALPN extension means our
      fingerprint doesn't match what it's supposed to.
      5a98c444
  3. Nov 05, 2018
  4. Jul 18, 2018
  5. Jul 17, 2018
  6. Mar 26, 2018
  7. Mar 21, 2018
  8. Mar 07, 2018
  9. Feb 16, 2018
    • David Fifield's avatar
    • David Fifield's avatar
      Have meek-client-torbrowser give meek-client a stdin that doesn't close. · a47e634f
      David Fifield authored
      https://bugs.torproject.org/24642
      
      Running meek-client-torbrowser with the environment variable
      TOR_PT_EXIT_ON_STDIN_CLOSE=1 would cause meek-client to exit
      immediately, as it sensed that its stdin was closed.
      meek-client-torbrowser was running the meek-client subprocess with a nil
      Stdin, which causes its stdin to be /dev/null (or NUL on Windows), which
      returns an immediate EOF. So instead, give meek-client an StdinPipe and
      just keep it open. (We could alternatively keep track of it and close it
      when necessary, but that would take further refactoring.)
      
      The commit where things would have first broken was
      0ec986eb (part of tag 0.28), which
      added TOR_PT_EXIT_ON_STDIN_CLOSE awareness to meek-client. But it was
      not meek-client's fault.
      
      This bug did not affect any releases of Tor Browser, despite that on
      Windows we unconditionally set TOR_PT_EXIT_ON_STDIN_CLOSE=1 via
      terminateprocess-buffer, because Tor Browser is still using tag 0.25,
      which doesn't have the TOR_PT_EXIT_ON_STDIN_CLOSE change in meek-client.
      a47e634f
  10. Jan 11, 2018
    • David Fifield's avatar
      Show an error when missing a meek-client command line. · dcfbef8d
      David Fifield authored
      Running meek-client-torbrowser without arguments would panic as it tried
      to index the nonexistent arguments.
      
      2018/01/11 21:02:07 running firefox command ["firefox" "--invisible" "-no-remote" "-profile" "TorBrowser/Data/Browser/profile.meek-http-helper"]
      2018/01/11 21:02:07 firefox started with pid 23721
      2018/01/11 21:02:08 killing PID 23721
      panic: runtime error: index out of range
      
      goroutine 1 [running]:
      panic(0x4e95a0, 0xc42000a110)
              /usr/lib/go-1.7/src/runtime/panic.go:500 +0x1a1
      main.runMeekClient(0xc420010589, 0xf, 0xc42000a2c0, 0x0, 0x0, 0x0, 0x10, 0xc42000e440)
              meek-client-torbrowser.go:267 +0x416
      main.main()
              meek-client-torbrowser.go:354 +0x3d2
      dcfbef8d
  11. Oct 01, 2017
  12. Sep 27, 2017
    • David Fifield's avatar
      Allow --port to set port 443 with --acme-hostnames. · 83daf8ad
      David Fifield authored
      --port is meant to override TOR_PT_SERVER_BINDADDR, but it was not
      overriding in the check for the presence of a bindaddr on port 443.
      
      SMETHOD-ERROR meek The --acme-hostnames option requires one of the bindaddrs to be on port 443.
      83daf8ad
  13. Sep 16, 2017
  14. Jul 26, 2017
  15. Jul 15, 2017
  16. Jun 29, 2017
  17. Apr 23, 2017
    • David Fifield's avatar
      Regen man pages. · 45132061
      David Fifield authored
    • David Fifield's avatar
      Update programVersion = "0.27". · 5bdd128a
      David Fifield authored
      5bdd128a
    • David Fifield's avatar
      Wait briefly after calling ListenAndServe{TLS} to see if it errors. · e3f3054f
      David Fifield authored
      An unfortunate effect of using net/http ListenAndServe and
      ListenAndServeTLS is that you don't get early errors like "permission
      denied" and "address already in use"--they happen later which means they
      appear only in the meek-server log, not in the tor log. Here we apply a
      hack to hold on for a fraction of a second to see if the call errors,
      hopefully long enough to catch most of such errors.
      e3f3054f
    • David Fifield's avatar
      Use ListenAndServe{TLS} rather than separate Listen and Serve. · cea86c93
      David Fifield authored
      The net/http package provides ListenAndServe and ListenAndServeTLS
      functions, but it doesn't provide a way to set up a listener without
      also entering an infinite serve loop. This matters for
      ListenAndServeTLS, which sets up a lot of magic behind the scenes for
      TLS and HTTP/2 support. Formerly, we had copy-pasted code from
      ListenAndServeTLS, but that code has only gotten more complicated in
      upstream net/http.
      
      The price we pay for this is that it's no longer possible for a server
      bindaddr to ask to listen on port 0 (i.e., a random ephemeral port).
      That's because we never get a change to find out what the listening
      address is, before entering the serve loop.
      
      What we gain is HTTP/2 support; formerly our copy-pasted code had the
      side effect of disabling HTTP/2, because it was copied from an older
      version and did things like
      	config.NextProtos = []string{"http/1.1"}
      
      The new code calls http2.ConfigureServer first, but that's not what's
      providing HTTP/2 support. HTTP/2 support happens by default. The reason
      we call http2.ConfigureServer is because we need to set
      TLSConfig.GetCertificate, and http2.ConfigureServer is a convenient way
      to initialize TLSConfig in a way that is guaranteed to work with HTTP/2.
      cea86c93
  18. Apr 20, 2017
  19. Apr 12, 2017
  20. Apr 11, 2017
Loading