SelfsignedKeyCertPair only works with German time format
Summary
When generating a SelfsignedKeyCertPair
the country code is expected as two letters, e.g. "DE" for Germany. But not every country uses only two letters for its language, e.g. USA has "English" which is more than two letters. The x509 certificate expects only two letters
Solutions
Set the default value for the country code to "DE"
or to empty string ""
. Fetching the country code based on the python locale
module is not reliable, as it just checks the user setting on region. The real location is not trivial to get, so it's best to make the country code an explicit parameter that needs to be set.
Was there an error message?
Process Process-1:
Traceback (most recent call last):
File "multiprocessing\process.py", line 314, in _bootstrap
File "multiprocessing\process.py", line 108, in run
File "eta_datarecorder\data_recorder.py", line 147, in main
File "eta_datarecorder\data_recorder.py", line 99, in run_datarecorder
File "eta_datarecorder\data_recorder.py", line 91, in _intialize_key_cert
File "eta_utility\util.py", line 477, in __init__
File "eta_utility\util.py", line 525, in generate_cert
File "cryptography\x509\name.py", line 142, in __init__
ValueError: Country name must be a 2 character country code
Steps to reproduce
Change date format to US or UK
Edited by Julius Balzer