Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Adrien Dorsaz
acme-dns-tiny
Commits
84338d52
Commit
84338d52
authored
Jun 07, 2021
by
Adrien Dorsaz
Browse files
relax certificate chain assertion
parent
ee5e5003
Pipeline
#300
passed with stages
in 16 minutes and 28 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
tests/staging_test_acme_dns_tiny.py
View file @
84338d52
...
...
@@ -67,12 +67,11 @@ class TestACMEDNSTiny(unittest.TestCase):
# helper function to valid success by making assertion on returned certificate chain
def
_assert_certificate_chain
(
self
,
cert_chain
):
# Output have to contains two certificates
certlist
=
cert_chain
.
split
(
"-----BEGIN CERTIFICATE-----"
)
self
.
assertEqual
(
3
,
len
(
certlist
))
self
.
assertEqual
(
''
,
certlist
[
0
])
self
.
assertIn
(
"-----END CERTIFICATE-----{0}"
.
format
(
os
.
linesep
),
certlist
[
1
])
self
.
assertIn
(
"-----END CERTIFICATE-----{0}"
.
format
(
os
.
linesep
),
certlist
[
2
])
# Output have to contain at least two certificates to create a chain
certlist
=
list
(
filter
(
None
,
cert_chain
.
split
(
"-----BEGIN CERTIFICATE-----"
)))
self
.
assertTrue
(
len
(
certlist
)
>=
2
)
for
cert
in
certlist
:
self
.
assertIn
(
"-----END CERTIFICATE-----"
,
cert
)
# Use openssl to check validity of chain and simple test of readability
readablecertchain
=
_openssl
(
"x509"
,
[
"-text"
,
"-noout"
],
cert_chain
.
encode
(
"utf8"
))
...
...
Write
Preview
Supports
Markdown
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