Skip to content

Commit

Permalink
fix CSR_PROFILES import
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo committed Jan 16, 2025
1 parent 4722490 commit 9ec29c8
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/middlewared/middlewared/plugins/truenas_connect/cert_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from middlewared.api.current import CSRPROFILES
from middlewared.plugins.crypto_.csr import generate_certificate_signing_request


Expand All @@ -21,6 +20,23 @@ def generate_csr(hostnames: list[str]) -> (str, str):
'organizational_unit': 'TNC',
'email': CERT_BOT_EMAIL,
'digest_algorithm': 'SHA256',
'cert_extensions': CSRPROFILES['HTTPS RSA Certificate']['cert_extensions'],
# We do not specify a common as domain hostname is bigger then 64 chars and cryptography starts complaining
'cert_extensions': {
'BasicConstraints': {
'enabled': True,
'ca': False,
'extension_critical': True,
},
'ExtendedKeyUsage': {
'enabled': True,
'extension_critical': True,
'usages': ['SERVER_AUTH', 'CLIENT_AUTH'],
},
'KeyUsage': {
'enabled': True,
'extension_critical': True,
'digital_signature': True,
'key_encipherment': True,
'key_agreement': True,
},
}
})

0 comments on commit 9ec29c8

Please sign in to comment.