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
03f9358d
Commit
03f9358d
authored
Sep 03, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
when checking SSL certs are OK, check for wildcard certificates
fixes #175 (hopefully)
parent
c7a2aad0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
status_checks.py
management/status_checks.py
+4
-2
No files found.
management/status_checks.py
View file @
03f9358d
...
@@ -360,7 +360,8 @@ def check_certificate(domain, ssl_certificate, ssl_private_key):
...
@@ -360,7 +360,8 @@ def check_certificate(domain, ssl_certificate, ssl_private_key):
# First check that the certificate is for the right domain. The domain
# First check that the certificate is for the right domain. The domain
# 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.
# Subject Alternative Names. A wildcard might also appear as the CN
# or in the SAN list, so check for that tool.
cert_dump
=
shell
(
'check_output'
,
[
cert_dump
=
shell
(
'check_output'
,
[
"openssl"
,
"x509"
,
"openssl"
,
"x509"
,
"-in"
,
ssl_certificate
,
"-in"
,
ssl_certificate
,
...
@@ -389,7 +390,8 @@ def check_certificate(domain, ssl_certificate, ssl_private_key):
...
@@ -389,7 +390,8 @@ def check_certificate(domain, ssl_certificate, ssl_private_key):
if
m
:
if
m
:
certificate_names
.
add
(
m
.
group
(
1
))
certificate_names
.
add
(
m
.
group
(
1
))
if
domain
is
not
None
and
domain
not
in
certificate_names
:
wildcard_domain
=
re
.
sub
(
"^[^
\
.]+"
,
"*"
,
domain
)
if
domain
is
not
None
and
domain
not
in
certificate_names
and
wildcard_domain
not
in
certificate_names
:
return
"This certificate is for the wrong domain names. It is for
%
s."
%
\
return
"This certificate is for the wrong domain names. It is for
%
s."
%
\
", "
.
join
(
sorted
(
certificate_names
))
", "
.
join
(
sorted
(
certificate_names
))
...
...
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