Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
letsencrypt.sh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
letsencrypt.sh
Commits
d3bc67eb
Commit
d3bc67eb
authored
Dec 16, 2015
by
Lukas Schauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more verbose messages on certificate verification
parent
341f5252
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
test.sh
test.sh
+10
-6
No files found.
test.sh
View file @
d3bc67eb
...
...
@@ -10,6 +10,7 @@ if [[ ! "${CI:-false}" == "true" ]]; then
fi
_TEST
()
{
echo
echo
"
${
1
}
"
}
_SUBTEST
()
{
...
...
@@ -31,7 +32,7 @@ _FAIL() {
exit
1
}
_CHECK_FILE
()
{
_SUBTEST
"Checking if file
exists:
${
1
}
"
_SUBTEST
"Checking if file
'
${
1
}
' exists...
"
if
[[
-e
"
${
1
}
"
]]
;
then
_PASS
else
...
...
@@ -39,7 +40,7 @@ _CHECK_FILE() {
fi
}
_CHECK_LOG
()
{
_SUBTEST
"Checking if log contains '
${
1
}
'"
_SUBTEST
"Checking if log contains '
${
1
}
'
...
"
if
grep
--
"
${
1
}
"
tmplog
>
/dev/null
;
then
_PASS
else
...
...
@@ -47,7 +48,7 @@ _CHECK_LOG() {
fi
}
_CHECK_NOT_LOG
()
{
_SUBTEST
"Checking if log doesn't contain '
${
1
}
'"
_SUBTEST
"Checking if log doesn't contain '
${
1
}
'
...
"
if
grep
--
"
${
1
}
"
tmplog
>
/dev/null
;
then
_FAIL
"Found in log:
${
1
}
"
else
...
...
@@ -150,10 +151,13 @@ rm account_key.pem
# Check if certificate is valid in various ways
_TEST
"Verifying certificate..."
openssl x509
-in
"certs/
${
TMP_URL
}
/cert.pem"
-noout
-text
>
tmplog 2> errorlog
_SUBTEST
"Verifying certificate on its own..."
openssl x509
-in
"certs/
${
TMP_URL
}
/cert.pem"
-noout
-text
>
tmplog 2> errorlog
&&
_PASS
||
_FAIL
_CHECK_LOG
"CN=
${
TMP_URL
}
"
openssl x509
-in
"certs/
${
TMP_URL
}
/fullchain.pem"
-noout
-text
>
/dev/null 2>> errorlog
(
openssl verify
-verbose
-CAfile
"certs/
${
TMP_URL
}
/fullchain.pem"
-purpose
sslserver
"certs/
${
TMP_URL
}
/fullchain.pem"
2>&1
||
true
)
|
(
grep
-v
': OK$'
||
true
)
>>
errorlog 2>> errorlog
_SUBTEST
"Verifying file with full chain..."
openssl x509
-in
"certs/
${
TMP_URL
}
/fullchain.pem"
-noout
-text
>
/dev/null 2>> errorlog
&&
_PASS
||
_FAIL
_SUBTEST
"Verifying certificate against CA certificate..."
(
openssl verify
-verbose
-CAfile
"certs/
${
TMP_URL
}
/fullchain.pem"
-purpose
sslserver
"certs/
${
TMP_URL
}
/fullchain.pem"
2>&1
||
true
)
|
(
grep
-v
': OK$'
||
true
)
>>
errorlog 2>> errorlog
&&
_PASS
||
_FAIL
_CHECK_ERRORLOG
# Revoke certificate using certificate key
...
...
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