diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-08-07 17:25:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-07 17:25:31 +0100 |
commit | 30c2325eaf85f28f438f9a3c7b703978eee66cf7 (patch) | |
tree | 5f19eff42aed9dce33dde9d3be9a0b514018326d /cmd | |
parent | 5dd5a411195c0565b4a3340dc53e2893b92f2800 (diff) |
Allow enforcing X.509 certificate validity (MSC1711) (#1249)
* Configurable X.509 certificate validation
* Fix dendritejs
* Update go.mod/go.sum for matrix-org/gomatrixserverlib#214
* Update sample config
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dendrite-demo-libp2p/main.go | 5 | ||||
-rw-r--r-- | cmd/dendrite-demo-yggdrasil/yggconn/client.go | 5 | ||||
-rw-r--r-- | cmd/dendrite-media-api-server/main.go | 2 | ||||
-rw-r--r-- | cmd/dendrite-monolith-server/main.go | 2 | ||||
-rw-r--r-- | cmd/dendritejs/main.go | 6 |
5 files changed, 11 insertions, 9 deletions
diff --git a/cmd/dendrite-demo-libp2p/main.go b/cmd/dendrite-demo-libp2p/main.go index 7333e8b4..93d54f21 100644 --- a/cmd/dendrite-demo-libp2p/main.go +++ b/cmd/dendrite-demo-libp2p/main.go @@ -75,7 +75,8 @@ func createFederationClient( p2phttp.NewTransport(base.LibP2P, p2phttp.ProtocolOption("/matrix")), ) return gomatrixserverlib.NewFederationClientWithTransport( - base.Base.Cfg.Matrix.ServerName, base.Base.Cfg.Matrix.KeyID, base.Base.Cfg.Matrix.PrivateKey, tr, + base.Base.Cfg.Matrix.ServerName, base.Base.Cfg.Matrix.KeyID, + base.Base.Cfg.Matrix.PrivateKey, true, tr, ) } @@ -87,7 +88,7 @@ func createClient( "matrix", p2phttp.NewTransport(base.LibP2P, p2phttp.ProtocolOption("/matrix")), ) - return gomatrixserverlib.NewClientWithTransport(tr) + return gomatrixserverlib.NewClientWithTransport(true, tr) } func main() { diff --git a/cmd/dendrite-demo-yggdrasil/yggconn/client.go b/cmd/dendrite-demo-yggdrasil/yggconn/client.go index 56afe264..9cb6f975 100644 --- a/cmd/dendrite-demo-yggdrasil/yggconn/client.go +++ b/cmd/dendrite-demo-yggdrasil/yggconn/client.go @@ -33,7 +33,7 @@ func (n *Node) CreateClient( }, }, ) - return gomatrixserverlib.NewClientWithTransport(tr) + return gomatrixserverlib.NewClientWithTransport(true, tr) } func (n *Node) CreateFederationClient( @@ -54,6 +54,7 @@ func (n *Node) CreateFederationClient( }, ) return gomatrixserverlib.NewFederationClientWithTransport( - base.Cfg.Matrix.ServerName, base.Cfg.Matrix.KeyID, base.Cfg.Matrix.PrivateKey, tr, + base.Cfg.Matrix.ServerName, base.Cfg.Matrix.KeyID, + base.Cfg.Matrix.PrivateKey, true, tr, ) } diff --git a/cmd/dendrite-media-api-server/main.go b/cmd/dendrite-media-api-server/main.go index 1582a33a..2b9c5090 100644 --- a/cmd/dendrite-media-api-server/main.go +++ b/cmd/dendrite-media-api-server/main.go @@ -26,7 +26,7 @@ func main() { defer base.Close() // nolint: errcheck userAPI := base.UserAPIClient() - client := gomatrixserverlib.NewClient() + client := gomatrixserverlib.NewClient(cfg.Matrix.FederationDisableTLSValidation) mediaapi.AddPublicRoutes(base.PublicAPIMux, base.Cfg, userAPI, client) diff --git a/cmd/dendrite-monolith-server/main.go b/cmd/dendrite-monolith-server/main.go index c75ef8fb..ed30685b 100644 --- a/cmd/dendrite-monolith-server/main.go +++ b/cmd/dendrite-monolith-server/main.go @@ -126,7 +126,7 @@ func main() { Config: base.Cfg, AccountDB: accountDB, DeviceDB: deviceDB, - Client: gomatrixserverlib.NewClient(), + Client: gomatrixserverlib.NewClient(cfg.Matrix.FederationDisableTLSValidation), FedClient: federation, KeyRing: keyRing, KafkaConsumer: base.KafkaConsumer, diff --git a/cmd/dendritejs/main.go b/cmd/dendritejs/main.go index fd407e6e..274d170e 100644 --- a/cmd/dendritejs/main.go +++ b/cmd/dendritejs/main.go @@ -139,16 +139,16 @@ func createFederationClient(cfg *config.Dendrite, node *go_http_js_libp2p.P2pLoc tr := go_http_js_libp2p.NewP2pTransport(node) fed := gomatrixserverlib.NewFederationClient( - cfg.Matrix.ServerName, cfg.Matrix.KeyID, cfg.Matrix.PrivateKey, + cfg.Matrix.ServerName, cfg.Matrix.KeyID, cfg.Matrix.PrivateKey, true, ) - fed.Client = *gomatrixserverlib.NewClientWithTransport(tr) + fed.Client = *gomatrixserverlib.NewClientWithTransport(true, tr) return fed } func createClient(node *go_http_js_libp2p.P2pLocalNode) *gomatrixserverlib.Client { tr := go_http_js_libp2p.NewP2pTransport(node) - return gomatrixserverlib.NewClientWithTransport(tr) + return gomatrixserverlib.NewClientWithTransport(true, tr) } func createP2PNode(privKey ed25519.PrivateKey) (serverName string, node *go_http_js_libp2p.P2pLocalNode) { |