Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opps, fix cert format #6

Merged
merged 1 commit into from
Dec 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions le.sh
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,16 @@ issue() {
done

_info "Verify finished, start to sign."
der=$(openssl req -in $CSR_PATH -outform DER | base64 | _b64)
der="$(openssl req -in $CSR_PATH -outform DER | base64 | _b64)"
_send_signed_request "$API/acme/new-cert" "{\"resource\": \"new-cert\", \"csr\": \"$der\"}"


Le_LinkCert=$(grep -i '^Location' $CURL_HEADER | cut -d " " -f 2)
Le_LinkCert="$(grep -i -o '^Location.*' $CURL_HEADER |sed 's/\r//g'| cut -d " " -f 2)"
_setopt $DOMAIN_CONF "Le_LinkCert" "=" "$Le_LinkCert"

if [ "$Le_LinkCert" ] ; then
if [ "$Le_LinkCert" ] ; then
echo -----BEGIN CERTIFICATE----- > $CERT_PATH
echo $response | base64 | sed "s/ /\n/g" >> $CERT_PATH
curl --silent $Le_LinkCert | base64 >> $CERT_PATH
echo -----END CERTIFICATE----- >> $CERT_PATH
_info "Cert success."
cat $CERT_PATH
Expand All @@ -415,7 +415,7 @@ issue() {
if [ "$Le_LinkIssuer" ] ; then
_get "$Le_LinkIssuer"
echo -----BEGIN CERTIFICATE----- > $CA_CERT_PATH
echo $response | base64 | sed "s/ /\n/g" >> $CA_CERT_PATH
curl --silent $Le_LinkIssuer | base64 >> $CA_CERT_PATH
echo -----END CERTIFICATE----- >> $CA_CERT_PATH
_info "The intermediate CA cert is in $CA_CERT_PATH"
fi
Expand Down