Accept --csr PEMFILE

* Closes: #1082 #1935
* Also produce better errors if SANs are missing, though not yet fixing #1076
This commit is contained in:
Peter Eckersley
2016-02-08 19:15:28 -08:00
parent 4831ec6ac0
commit 63c0718d86
2 changed files with 27 additions and 8 deletions
+4 -3
View File
@@ -195,7 +195,8 @@ class Client(object):
else:
self.auth_handler = None
def obtain_certificate_from_csr(self, domains, csr):
def obtain_certificate_from_csr(self, domains, csr,
typ=OpenSSL.crypto.FILETYPE_ASN1):
"""Obtain certificate.
Internal function with precondition that `domains` are
@@ -223,8 +224,8 @@ class Client(object):
authzr = self.auth_handler.get_authorizations(domains)
certr = self.acme.request_issuance(
jose.ComparableX509(OpenSSL.crypto.load_certificate_request(
OpenSSL.crypto.FILETYPE_ASN1, csr.data)),
jose.ComparableX509(
OpenSSL.crypto.load_certificate_request(typ, csr.data)),
authzr)
return certr, self.acme.fetch_chain(certr)