code: func (cl *Client) establishOutgoingConn(t *Torrent, addr IpPort) (c *connection, err error) {
  	torrent.Add("establish outgoing connection", 1)
  	ctx, cancel := context.WithTimeout(context.Background(), func() time.Duration {
  		cl.rLock()
  		defer cl.rUnlock()
  		return t.dialTimeout()
  	}())
  	defer cancel()
  	obfuscatedHeaderFirst := !cl.config.DisableEncryption && !cl.config.PreferNoEncryption
  	c, err = cl.establishOutgoingConnEx(t, addr, ctx, obfuscatedHeaderFirst)
  	if err != nil {
  		return
  	}
  	if c != nil {
  		torrent.Add("initiated conn with preferred header obfuscation", 1)
  		return
  	}
  	if cl.config.ForceEncryption {
  		// We should have just tried with an obfuscated header. A plaintext
  		// header can't result in an encrypted connection, so we're done.
  		if !obfuscatedHeaderFirst {
  			panic(cl.config.EncryptionPolicy)
  		}
  		return
  	}
  	// Try again with encryption if we didn't earlier, or without if we did.
  	c, err = cl.establishOutgoingConnEx(t, addr, ctx, !obfuscatedHeaderFirst)
  	if c != nil {
  		torrent.Add("initiated conn with fallback header obfuscation", 1)
  	}
  	return
  }
docs: // Returns nil connection and nil error if no connection could be established
  // for valid reasons.