mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 09:51:36 +00:00
suppress warning on private key create. Fixes #1725
This commit is contained in:
@@ -12418,9 +12418,16 @@ def _generatePrivateKeyAndPublicCert(projectId, clientEmail, name, key_size, b64
|
||||
writeStdout(Msg.EXTRACTING_PUBLIC_CERTIFICATE+'\n')
|
||||
public_key = private_key.public_key()
|
||||
builder = x509.CertificateBuilder()
|
||||
builder = builder.subject_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, name, _validate=False)]))
|
||||
builder = builder.issuer_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, name, _validate=False)]))
|
||||
# Gooogle seems to enforce the not before date strictly. Set the not before
|
||||
# suppress cryptography warnings on service account email length
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings('ignore', message='.*Attribute\'s length.*')
|
||||
builder = builder.subject_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME,
|
||||
name,
|
||||
_validate=False)]))
|
||||
builder = builder.issuer_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME,
|
||||
name,
|
||||
_validate=False)]))
|
||||
# Google seems to enforce the not before date strictly. Set the not before
|
||||
# date to be UTC two minutes ago which should cover any clock skew.
|
||||
now = datetime.datetime.utcnow()
|
||||
builder = builder.not_valid_before(now - datetime.timedelta(minutes=2))
|
||||
|
||||
Reference in New Issue
Block a user