Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
ac2d5123
Commit
ac2d5123
authored
Apr 05, 2016
by
neil
Browse files
add command "toPkcs" to convert cert file to pfx file.
parent
b09d597c
Changes
1
Hide whitespace changes
Inline
Side-by-side
le.sh
View file @
ac2d5123
...
...
@@ -206,6 +206,28 @@ _ss() {
return
1
}
toPkcs
()
{
domain
=
"
$1
"
pfxPassword
=
"
$2
"
if
[[
-z
"
$domain
"
]]
;
then
_err
"Usage: toPkcs domain [pfx-password]"
return
1
fi
_initpath
"
$domain
"
if
[[
"
$pfxPassword
"
]]
;
then
openssl pkcs12
-export
-out
"
$CERT_PFX_PATH
"
-inkey
"
$CERT_KEY_PATH
"
-in
"
$CERT_PATH
"
-certfile
"
$CA_CERT_PATH
"
-password
"pass:
$pfxPassword
"
else
openssl pkcs12
-export
-out
"
$CERT_PFX_PATH
"
-inkey
"
$CERT_KEY_PATH
"
-in
"
$CERT_PATH
"
-certfile
"
$CA_CERT_PATH
"
fi
if
[[
"
$?
"
==
"0"
]]
;
then
_info
"Success, Pfx is exported to:
$CERT_PFX_PATH
"
fi
}
#domain [2048]
createAccountKey
()
{
_info
"Creating account key"
...
...
@@ -725,7 +747,9 @@ _initpath() {
if
[
-z
"
$CERT_FULLCHAIN_PATH
"
]
;
then
CERT_FULLCHAIN_PATH
=
"
$domainhome
/fullchain.cer"
fi
if
[
-z
"
$CERT_PFX_PATH
"
]
;
then
CERT_PFX_PATH
=
"
$domainhome
/
$domain
.pfx"
fi
}
...
...
@@ -1344,6 +1368,7 @@ renewAll() {
CERT_KEY_PATH
=
""
CERT_PATH
=
""
CA_CERT_PATH
=
""
CERT_PFX_PATH
=
""
CERT_FULLCHAIN_PATH
=
""
ACCOUNT_KEY_PATH
=
""
...
...
@@ -1651,7 +1676,7 @@ version() {
showhelp
()
{
version
echo
"Usage: le.sh [command] ...[args]....
Ava
l
ible commands:
Avai
la
ble commands:
install:
Install le.sh to your system.
...
...
@@ -1671,6 +1696,8 @@ installcronjob:
Install the cron job to renew certs, you don't need to call this. The 'install' command can automatically install the cron job.
uninstallcronjob:
Uninstall the cron job. The 'uninstall' command can do this automatically.
toPkcs:
Export the certificate and key to a pfx file.
createAccountKey:
Create an account private key, professional use.
createDomainKey:
...
...
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