0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-25 18:33:48 +01:00

Try that again

This commit is contained in:
Neil Alexander 2022-11-17 09:32:19 +00:00
parent 607819f425
commit 16325203af
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -159,12 +159,12 @@ loop:
}
}
identity, err := cfg.Matrix.SigningIdentityFor(serverName)
if err != nil {
identity, _ = cfg.Matrix.SigningIdentityFor(cfg.Matrix.ServerName)
var identity *gomatrixserverlib.SigningIdentity
var err error
if virtualHost == nil {
if identity, err = cfg.Matrix.SigningIdentityFor(cfg.Matrix.ServerName); err != nil {
return nil, err
}
if identity.ServerName == serverName {
publicKey := cfg.Matrix.PrivateKey.Public().(ed25519.PublicKey)
keys.ServerName = cfg.Matrix.ServerName
keys.ValidUntilTS = gomatrixserverlib.AsTimestamp(time.Now().Add(cfg.Matrix.KeyValidityPeriod))
@ -183,6 +183,9 @@ loop:
}
}
} else {
if identity, err = cfg.Matrix.SigningIdentityFor(virtualHost.ServerName); err != nil {
return nil, err
}
publicKey := virtualHost.PrivateKey.Public().(ed25519.PublicKey)
keys.ServerName = virtualHost.ServerName
keys.ValidUntilTS = gomatrixserverlib.AsTimestamp(time.Now().Add(virtualHost.KeyValidityPeriod))