Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import base64
import os
from OpenSSL import crypto
import urllib.parse

from cryptography import x509
from cryptography.hazmat.primitives.serialization import pkcs12
Expand Down Expand Up @@ -50,6 +51,14 @@ def _run(self):
if current_template is None:
current_template = "Machine" if self.username.endswith("$") else "User"

# Template name might be UTF-8
original_template = current_template
current_template = urllib.parse.quote(current_template)
if current_template == original_template:
LOG.info('Using template name: %s' % current_template)
else:
LOG.info('Using template name: %s (%s)' % (current_template, original_template))

csr = self.generate_csr(key, self.username, self.config.altName)
csr = csr.decode().replace("\n", "").replace("+", "%2b").replace(" ", "+")
LOG.info("CSR generated!")
Expand Down