Skip to content

Commit

Permalink
Merge pull request #224 from dougbenjamin/dougbenjamin-patch-1
Browse files Browse the repository at this point in the history
Update cleanDN.py
  • Loading branch information
mightqxc authored Apr 17, 2024
2 parents df13534 + dccbfa0 commit 11787d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pandaharvester/harvestertest/cleanDN.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ def clean_user_id(id):
p = subprocess.Popen(com.split() + [certFile], stdout=subprocess.PIPE)
out, err = p.communicate()

# Convert bytes object to string object if needed
try:
out = out.decode("utf-8")
except (UnicodeDecodeError, AttributeError):
pass

out = re.sub("^subject=", "", out)
out = out.strip()
print(f'DN: "{out}"')
Expand Down

0 comments on commit 11787d4

Please sign in to comment.