protocols: fix typo in TLS cert rotation code

This commit is contained in:
Alberto Sottile 2019-02-19 09:41:41 +01:00
parent 890e8ea2ab
commit 0b19d526a1

View File

@ -2,7 +2,6 @@
import json import json
import time import time
from functools import wraps from functools import wraps
from os.path import getmtime
from twisted.protocols.basic import LineReceiver from twisted.protocols.basic import LineReceiver
from twisted.internet.interfaces import IHandshakeListener from twisted.internet.interfaces import IHandshakeListener
@ -671,7 +670,7 @@ class SyncServerProtocol(JSONCommandProtocol):
inquiry = message["startTLS"] if "startTLS" in message else None inquiry = message["startTLS"] if "startTLS" in message else None
if "send" in inquiry: if "send" in inquiry:
if not self.isLogged() and self._factory.serverAcceptsTLS and self._factory.options is not None: if not self.isLogged() and self._factory.serverAcceptsTLS and self._factory.options is not None:
if self._factory.checkLastEditCertTime() > self.lastEditCertTime: if self._factory.checkLastEditCertTime() > self._factory.lastEditCertTime:
self._factory.updateTLSContextFactory() self._factory.updateTLSContextFactory()
self.sendTLS({"startTLS": "true"}) self.sendTLS({"startTLS": "true"})
self.transport.startTLS(self._factory.options) self.transport.startTLS(self._factory.options)