2016-12-14 17:30:13 -08:00
|
|
|
from lemur import database
|
2016-12-07 16:24:59 -08:00
|
|
|
|
|
|
|
|
|
|
|
def rotate_certificate(endpoint, new_cert):
|
|
|
|
"""
|
|
|
|
Rotates a certificate on a given endpoint.
|
|
|
|
|
|
|
|
:param endpoint:
|
|
|
|
:param new_cert:
|
|
|
|
:return:
|
|
|
|
"""
|
2017-02-03 11:21:53 -08:00
|
|
|
# ensure that certificate is available for rotation
|
2016-12-14 17:30:13 -08:00
|
|
|
endpoint.source.plugin.update_endpoint(endpoint, new_cert)
|
|
|
|
endpoint.certificate = new_cert
|
|
|
|
database.update(endpoint)
|