Backportable subset of: openssl_csr: deprecate version option (#63432) (#63675)

Cherry-picked from ba686154b9.
pull/64126/head
Felix Fontein 6 years ago committed by Matt Davis
parent 484fd8271e
commit 0846bb85d3

@ -0,0 +1,2 @@
bugfixes:
- "openssl_csr - a warning is issued if an unsupported value for ``version`` is used for the ``cryptography`` backend."

@ -54,6 +54,8 @@ options:
version:
description:
- The version of the certificate signing request.
- "The only allowed value according to L(RFC 2986,https://tools.ietf.org/html/rfc2986#section-4.1)
is 1."
type: int
default: 1
force:
@ -653,6 +655,8 @@ class CertificateSigningRequestCryptography(CertificateSigningRequestBase):
def __init__(self, module):
super(CertificateSigningRequestCryptography, self).__init__(module)
self.cryptography_backend = cryptography.hazmat.backends.default_backend()
if self.version != 1:
module.warn('The cryptography backend only supports version 1. (The only valid value according to RFC 2986.)')
def _generate_csr(self):
csr = cryptography.x509.CertificateSigningRequestBuilder()

Loading…
Cancel
Save