mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 23:48:27 +00:00
Try that again
This commit is contained in:
parent
607819f425
commit
16325203af
1 changed files with 9 additions and 6 deletions
|
@ -159,12 +159,12 @@ loop:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
identity, err := cfg.Matrix.SigningIdentityFor(serverName)
|
var identity *gomatrixserverlib.SigningIdentity
|
||||||
if err != nil {
|
var err error
|
||||||
identity, _ = cfg.Matrix.SigningIdentityFor(cfg.Matrix.ServerName)
|
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)
|
publicKey := cfg.Matrix.PrivateKey.Public().(ed25519.PublicKey)
|
||||||
keys.ServerName = cfg.Matrix.ServerName
|
keys.ServerName = cfg.Matrix.ServerName
|
||||||
keys.ValidUntilTS = gomatrixserverlib.AsTimestamp(time.Now().Add(cfg.Matrix.KeyValidityPeriod))
|
keys.ValidUntilTS = gomatrixserverlib.AsTimestamp(time.Now().Add(cfg.Matrix.KeyValidityPeriod))
|
||||||
|
@ -183,6 +183,9 @@ loop:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if identity, err = cfg.Matrix.SigningIdentityFor(virtualHost.ServerName); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
publicKey := virtualHost.PrivateKey.Public().(ed25519.PublicKey)
|
publicKey := virtualHost.PrivateKey.Public().(ed25519.PublicKey)
|
||||||
keys.ServerName = virtualHost.ServerName
|
keys.ServerName = virtualHost.ServerName
|
||||||
keys.ValidUntilTS = gomatrixserverlib.AsTimestamp(time.Now().Add(virtualHost.KeyValidityPeriod))
|
keys.ValidUntilTS = gomatrixserverlib.AsTimestamp(time.Now().Add(virtualHost.KeyValidityPeriod))
|
||||||
|
|
Loading…
Reference in a new issue