diff --git a/nextcloudappstore/core/certificate/validator.py b/nextcloudappstore/core/certificate/validator.py index 1c5e228daf..8df088da42 100644 --- a/nextcloudappstore/core/certificate/validator.py +++ b/nextcloudappstore/core/certificate/validator.py @@ -115,4 +115,8 @@ class CertificateValidator: raise CertificateAppIdMismatchException(msg) def _to_cert(self, certificate: str) -> X509: - return load_certificate(FILETYPE_PEM, certificate.encode()) + try: + return load_certificate(FILETYPE_PEM, certificate.encode()) + except Exception as e: + msg = '%s: %s' % ('Invalid certificate', str(e)) + raise InvalidCertificateException(msg) diff --git a/nextcloudappstore/core/scaffolding/forms.py b/nextcloudappstore/core/scaffolding/forms.py index 203bf53ed5..bc8c41ff22 100644 --- a/nextcloudappstore/core/scaffolding/forms.py +++ b/nextcloudappstore/core/scaffolding/forms.py @@ -22,7 +22,7 @@ def get_versions(): def validate_id(input: str) -> str: - regex = r'^([A-Z][a-z]+)+$' + regex = r'^([A-Z][a-z]*)+$' if not re.match(regex, input): raise ValidationError(_('The app name must be camel case e.g. MyApp'))