Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
a56bb984
Commit
a56bb984
authored
Oct 07, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle catastrophically bad certificates rather than raising an exception
parent
7d1c0b38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
status_checks.py
management/status_checks.py
+9
-2
No files found.
management/status_checks.py
View file @
a56bb984
...
@@ -413,11 +413,18 @@ def check_certificate(domain, ssl_certificate, ssl_private_key):
...
@@ -413,11 +413,18 @@ def check_certificate(domain, ssl_certificate, ssl_private_key):
# must be found in the Subject Common Name (CN) or be one of the
# must be found in the Subject Common Name (CN) or be one of the
# Subject Alternative Names. A wildcard might also appear as the CN
# Subject Alternative Names. A wildcard might also appear as the CN
# or in the SAN list, so check for that tool.
# or in the SAN list, so check for that tool.
cert_dump
=
shell
(
'check_output'
,
[
retcode
,
cert_dump
=
shell
(
'check_output'
,
[
"openssl"
,
"x509"
,
"openssl"
,
"x509"
,
"-in"
,
ssl_certificate
,
"-in"
,
ssl_certificate
,
"-noout"
,
"-text"
,
"-nameopt"
,
"rfc2253"
,
"-noout"
,
"-text"
,
"-nameopt"
,
"rfc2253"
,
])
],
trap
=
True
)
# If the certificate is catastrophically bad, catch that now and report it.
# More information was probably written to stderr (which we aren't capturing),
# but it is probably not helpful to the user anyway.
if
retcode
!=
0
:
return
(
"The SSL certificate file at
%
s appears to be corrupted or not a PEM-formatted SSL certificate file."
%
ssl_certificate
,
None
)
cert_dump
=
cert_dump
.
split
(
"
\n
"
)
cert_dump
=
cert_dump
.
split
(
"
\n
"
)
certificate_names
=
set
()
certificate_names
=
set
()
cert_expiration_date
=
None
cert_expiration_date
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment