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
063d28a6
Commit
063d28a6
authored
Dec 07, 2015
by
Markus Germeier
Committed by
Lukas Schauer
Dec 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement revoke
parent
0d7913ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
letsencrypt.sh
letsencrypt.sh
+24
-0
No files found.
letsencrypt.sh
View file @
063d28a6
...
@@ -107,6 +107,17 @@ signed_request() {
...
@@ -107,6 +107,17 @@ signed_request() {
_request post
"
${
1
}
"
"
${
data
}
"
_request post
"
${
1
}
"
"
${
data
}
"
}
}
revoke_cert
()
{
cert
=
"
${
1
}
"
cert64
=
"
$(
openssl x509
-in
"
${
cert
}
"
-inform
PEM
-outform
DER | urlbase64
)
"
response
=
"
$(
signed_request
"
${
CA
}
/acme/revoke-cert"
'{"resource": "revoke-cert", "certificate": "'
"
${
cert64
}
"
'"}'
)
"
# if there is a problem with our revoke request _request (via signed_request) will report this and "exit 1" out
# so if we are here, it is safe to assume the request was successful
echo
" + SUCCESS"
echo
" + renaming certificate to
${
cert
}
-revoked"
mv
-f
"
${
cert
}
"
"
${
cert
}
-revoked"
}
sign_domain
()
{
sign_domain
()
{
domain
=
"
${
1
}
"
domain
=
"
${
1
}
"
altnames
=
"
${
*
}
"
altnames
=
"
${
*
}
"
...
@@ -255,6 +266,19 @@ if [[ ! -e "${WELLKNOWN}" ]]; then
...
@@ -255,6 +266,19 @@ if [[ ! -e "${WELLKNOWN}" ]]; then
mkdir
-p
"
${
WELLKNOWN
}
"
mkdir
-p
"
${
WELLKNOWN
}
"
fi
fi
# revoke certificate by user request
if
[[
"
${
1
:-}
"
=
"revoke"
]]
;
then
if
[[
-z
"{2:-}"
]]
||
[[
!
-f
"
${
2
}
"
]]
;
then
echo
usage:
${
0
}
revoke path/to/cert.pem
exit
1
fi
echo
"Revoking
${
2
}
"
revoke_cert
"
${
2
}
"
exit
0
fi
# Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire
# Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire
<
"
${
DOMAINS_TXT
}
"
sed
's/^\s*//g;s/\s*$//g'
|
grep
-v
'^#'
|
grep
-v
'^$'
|
while
read
-r
line
;
do
<
"
${
DOMAINS_TXT
}
"
sed
's/^\s*//g;s/\s*$//g'
|
grep
-v
'^#'
|
grep
-v
'^$'
|
while
read
-r
line
;
do
domain
=
"
$(
echo
"
${
line
}
"
|
cut
-d
' '
-f1
)
"
domain
=
"
$(
echo
"
${
line
}
"
|
cut
-d
' '
-f1
)
"
...
...
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