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
429ec400
Commit
429ec400
authored
Jan 20, 2016
by
Niels Laukens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --signcsr command
parent
a62968c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
README.md
README.md
+2
-0
letsencrypt.sh
letsencrypt.sh
+27
-0
No files found.
README.md
View file @
429ec400
...
@@ -8,6 +8,7 @@ Other dependencies are: curl, sed, grep, mktemp (all found on almost any system,
...
@@ -8,6 +8,7 @@ Other dependencies are: curl, sed, grep, mktemp (all found on almost any system,
Current features:
Current features:
-
Signing of a list of domains
-
Signing of a list of domains
-
Signing of a CSR
-
Renewal if a certificate is about to expire or SAN (subdomains) changed
-
Renewal if a certificate is about to expire or SAN (subdomains) changed
-
Certificate revocation
-
Certificate revocation
...
@@ -25,6 +26,7 @@ Default command: help
...
@@ -25,6 +26,7 @@ Default command: help
Commands:
Commands:
--cron (-c) Sign/renew non-existant/changed/expiring certificates.
--cron (-c) Sign/renew non-existant/changed/expiring certificates.
--signcsr (-s) path/to/csr.pem Sign a given CSR, output CRT on stdout (advanced usage)
--revoke (-r) path/to/cert.pem Revoke specified certificate
--revoke (-r) path/to/cert.pem Revoke specified certificate
--help (-h) Show help text
--help (-h) Show help text
--env (-e) Output configuration variables for use in other scripts
--env (-e) Output configuration variables for use in other scripts
...
...
letsencrypt.sh
View file @
429ec400
...
@@ -526,6 +526,25 @@ command_sign_domains() {
...
@@ -526,6 +526,25 @@ command_sign_domains() {
exit
0
exit
0
}
}
# Usage: --signcsr (-s) path/to/csr.pem
# Description: Sign a given CSR, output CRT on stdout (advanced usage)
command_sign_csr
()
{
# redirect stdout to stderr
# leave stdout over at fd 3 to output the cert
exec
3>&1 1>&2
init_system
csrfile
=
"
${
1
}
"
if
[
!
-r
"
${
csrfile
}
"
]
;
then
_exiterr
"Could not read certificate signing request
${
csrfile
}
"
fi
sign_csr
"
$(
<
"
${
csrfile
}
"
)
"
exit
0
}
# Usage: --revoke (-r) path/to/cert.pem
# Usage: --revoke (-r) path/to/cert.pem
# Description: Revoke specified certificate
# Description: Revoke specified certificate
command_revoke
()
{
command_revoke
()
{
...
@@ -622,6 +641,13 @@ main() {
...
@@ -622,6 +641,13 @@ main() {
set_command sign_domains
set_command sign_domains
;;
;;
--signcsr
|
-s
)
shift
1
set_command sign_csr
check_parameters
"
${
1
:-}
"
PARAM_CSR
=
"
${
1
}
"
;;
--revoke
|
-r
)
--revoke
|
-r
)
shift
1
shift
1
set_command revoke
set_command revoke
...
@@ -702,6 +728,7 @@ main() {
...
@@ -702,6 +728,7 @@ main() {
case
"
${
COMMAND
}
"
in
case
"
${
COMMAND
}
"
in
env
)
command_env
;;
env
)
command_env
;;
sign_domains
)
command_sign_domains
;;
sign_domains
)
command_sign_domains
;;
sign_csr
)
command_sign_csr
"
${
PARAM_CSR
}
"
;;
revoke
)
command_revoke
"
${
PARAM_REVOKECERT
}
"
;;
revoke
)
command_revoke
"
${
PARAM_REVOKECERT
}
"
;;
*
)
command_help
;
exit
1
;;
*
)
command_help
;
exit
1
;;
esac
esac
...
...
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