mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-11 16:13:10 -06:00
Make it optional
This commit is contained in:
parent
b879830d50
commit
17dde947ca
|
|
@ -212,6 +212,13 @@ federation_api:
|
|||
# enable this option in production as it presents a security risk!
|
||||
disable_tls_validation: false
|
||||
|
||||
# Disable HTTP keepalives, which also prevents connection reuse. Dendrite will typically
|
||||
# keep HTTP connections open to remote hosts for 5 minutes as they can be reused much
|
||||
# more quickly than opening new connections each time. Disabling keepalives will close
|
||||
# HTTP connections immediately after a successful request but may result in more CPU and
|
||||
# memory being used on TLS handshakes for each new connection instead.
|
||||
disable_http_keepalives: false
|
||||
|
||||
# Perspective keyservers to use as a backup when direct key fetches fail. This may
|
||||
# be required to satisfy key requests for servers that are no longer online when
|
||||
# joining some rooms.
|
||||
|
|
|
|||
|
|
@ -219,6 +219,13 @@ federation_api:
|
|||
# enable this option in production as it presents a security risk!
|
||||
disable_tls_validation: false
|
||||
|
||||
# Disable HTTP keepalives, which also prevents connection reuse. Dendrite will typically
|
||||
# keep HTTP connections open to remote hosts for 5 minutes as they can be reused much
|
||||
# more quickly than opening new connections each time. Disabling keepalives will close
|
||||
# HTTP connections immediately after a successful request but may result in more CPU and
|
||||
# memory being used on TLS handshakes for each new connection instead.
|
||||
disable_http_keepalives: false
|
||||
|
||||
# Perspective keyservers to use as a backup when direct key fetches fail. This may
|
||||
# be required to satisfy key requests for servers that are no longer online when
|
||||
# joining some rooms.
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ func (b *BaseDendrite) CreateFederationClient() *gomatrixserverlib.FederationCli
|
|||
opts := []gomatrixserverlib.ClientOption{
|
||||
gomatrixserverlib.WithTimeout(time.Minute * 5),
|
||||
gomatrixserverlib.WithSkipVerify(b.Cfg.FederationAPI.DisableTLSValidation),
|
||||
gomatrixserverlib.WithKeepAlives(true),
|
||||
gomatrixserverlib.WithKeepAlives(!b.Cfg.FederationAPI.DisableHTTPKeepalives),
|
||||
}
|
||||
if b.Cfg.Global.DNSCache.Enabled {
|
||||
opts = append(opts, gomatrixserverlib.WithDNSCache(b.DNSCache))
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ type FederationAPI struct {
|
|||
// on remote federation endpoints. This is not recommended in production!
|
||||
DisableTLSValidation bool `yaml:"disable_tls_validation"`
|
||||
|
||||
// DisableHTTPKeepalives prevents Dendrite from keeping HTTP connections
|
||||
// open for reuse for future requests. Connections will be closed quicker
|
||||
// but we may spend more time on TLS handshakes instead.
|
||||
DisableHTTPKeepalives bool `yaml:"disable_http_keepalives"`
|
||||
|
||||
// Perspective keyservers, to use as a backup when direct key fetch
|
||||
// requests don't succeed
|
||||
KeyPerspectives KeyPerspectives `yaml:"key_perspectives"`
|
||||
|
|
@ -39,6 +44,7 @@ func (c *FederationAPI) Defaults(opts DefaultOpts) {
|
|||
}
|
||||
c.FederationMaxRetries = 16
|
||||
c.DisableTLSValidation = false
|
||||
c.DisableHTTPKeepalives = false
|
||||
if opts.Generate {
|
||||
c.KeyPerspectives = KeyPerspectives{
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue