[tor-dev] RFC: Using `utls` in meek_lite.

Yawning Angel yawning at schwanenlied.me
Thu Jan 24 07:33:39 UTC 2019


On 1/24/19 6:47 AM, David Fifield wrote:
> 	// This also assumes that req.URL.Host will remain constant for the
> 	// lifetime of the roundTripper, which is a valid assumption for meeklite.
> 
> Am I wrong, or is the actual restriction less strict? You can reuse the
> roundTripper for different hosts--the ServerName is taken from the addr
> argument to dialTLS--but only if those different hosts negotiate the
> same ALPN, because the choice of http.Transport or http2.Transport is
> made only once and persists for the lifetime of the roundTripper.
The lock protecting `roundTripper.initConn` is only held in `dialTLS`,
and the `roundTripper.transport` is not protected by a lock at all.

If the target host changes and there is simultaneous access (two threads
call into `roundTripper.RoundTrip` right after initialization
simultaneously), there is no guarantee that the connection used to
create the inner `http.RoundTripper` instance will be passed to the
correct thread.

Regards,

-- 
Yawning Angel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20190124/52d158d6/attachment.sig>


More information about the tor-dev mailing list