One-shot STS policies should still be cleared if a reconnect fails
This commit is contained in:
parent
5981bfa04c
commit
061a4ede23
1 changed files with 10 additions and 13 deletions
|
@ -38,16 +38,13 @@ class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("new.server")
|
@utils.hook("new.server")
|
||||||
def new_server(self, event):
|
def new_server(self, event):
|
||||||
sts_policy = event["server"].get_setting("sts-policy")
|
sts_policy = event["server"].get_setting("sts-policy")
|
||||||
if sts_policy and not event["server"].tls:
|
if sts_policy:
|
||||||
expiration = sts_policy["expiration"]
|
if sts_policy["one-shot"]:
|
||||||
if not expiration or time.time() <= expiration:
|
event["server"].del_setting("sts-policy")
|
||||||
self.log.debug("Applying STS policy for '%s'",
|
if not event["server"].tls:
|
||||||
[str(event["server"])])
|
expiration = sts_policy["expiration"]
|
||||||
event["server"].tls = True
|
if not expiration or time.time() <= expiration:
|
||||||
event["server"].port = sts_policy["port"]
|
self.log.debug("Applying STS policy for '%s'",
|
||||||
|
[str(event["server"])])
|
||||||
@utils.hook("received.numeric.001"):
|
event["server"].tls = True
|
||||||
def on_connect(self, event):
|
event["server"].port = sts_policy["port"]
|
||||||
sts_policy = event["server"].get_setting("sts-policy")
|
|
||||||
if sts_policy and sts_policy["one-shot"]:
|
|
||||||
event["server"].del_setting("sts-policy")
|
|
||||||
|
|
Loading…
Reference in a new issue