Skip to content

Commit

Permalink
Do not allow changing anything for tnc cert
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicaj committed Dec 18, 2024
1 parent 5e7c62b commit a0bd1a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/middlewared/middlewared/plugins/crypto_/certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,13 @@ async def do_update(self, job, id_, data):
if any(new.get(k) != old.get(k) for k in ('name', 'revoked', 'renew_days', 'add_to_trusted_store')):

verrors = ValidationErrors()
tnc_config = await self.middleware.call('tn_connect.config')
if tnc_config['certificate'] == id_:
verrors.add(
'certificate_update.name',
'This certificate is being used by TrueNAS Connect service and cannot be modified'
)
verrors.check()

if new['name'] != old['name']:
await validate_cert_name(
Expand Down

0 comments on commit a0bd1a7

Please sign in to comment.