diff --git a/lemur/common/schema.py b/lemur/common/schema.py index f7f2caf4..c43c8cd3 100644 --- a/lemur/common/schema.py +++ b/lemur/common/schema.py @@ -136,7 +136,7 @@ def validate_schema(input_schema, output_schema): resp = f(*args, **kwargs) except Exception as e: current_app.logger.exception(e) - return dict(message=e.message), 500 + return dict(message=str(e)), 500 if isinstance(resp, tuple): return resp[0], resp[1] diff --git a/lemur/common/utils.py b/lemur/common/utils.py index ec21cc7e..56bb9083 100644 --- a/lemur/common/utils.py +++ b/lemur/common/utils.py @@ -6,6 +6,7 @@ .. moduleauthor:: Kevin Glisson """ +import six import sys import string import random @@ -36,11 +37,13 @@ def get_psuedo_random_string(): def parse_certificate(body): - if sys.version_info >= (3, 0): - if isinstance(body, bytes): - return x509.load_pem_x509_certificate(body, default_backend()) - return x509.load_pem_x509_certificate(bytes(body, 'utf8'), default_backend()) - return x509.load_pem_x509_certificate(body.encode('utf-8'), default_backend()) + if sys.version_info[0] <= 2: + return x509.load_pem_x509_certificate(bytes(body), default_backend()) + + if isinstance(body, six.string_types): + body = body.encode('utf-8') + + return x509.load_pem_x509_certificate(body, default_backend()) def is_weekend(date): diff --git a/lemur/plugins/lemur_verisign/plugin.py b/lemur/plugins/lemur_verisign/plugin.py index b2ea30bc..2aa2690a 100644 --- a/lemur/plugins/lemur_verisign/plugin.py +++ b/lemur/plugins/lemur_verisign/plugin.py @@ -21,7 +21,6 @@ from lemur.common.utils import get_psuedo_random_string # https://support.venafi.com/entries/66445046-Info-VeriSign-Error-Codes VERISIGN_ERRORS = { "0x30c5": "Domain Mismatch when enrolling for an SSL certificate, a domain in your request has not been added to verisign", - "0x482d": "Cannot issue SHA1 certificates expiring after 31/12/2016", "0x3a10": "Invalid X509 certificate format.: an unsupported certificate format was submitted", "0x4002": "Internal QM Error. : Internal Database connection error.", "0x3301": "Bad transaction id or parent cert not renewable.: User try to renew a certificate that is not yet ready for renew or the transaction id is wrong", @@ -58,6 +57,7 @@ VERISIGN_ERRORS = { "0x3105": "Organization Name Not Matched", "0x300a": "Domain/SubjectAltName Mismatched -- make sure that the SANs have the proper domain suffix", "0x950e": "Invalid Common Name -- make sure the CN has a proper domain suffix", + "0xa00e": "Pending. (Insufficient number of tokens.)" }