File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
- ## 1.0.0 (Month Date, Year )
3
+ ## 1.0.0 (March 25, 2024 )
4
4
5
- Initial release of the NGINX template repository .
5
+ Initial release of njs-acme .
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ async function clientAutoModeInternal(
88
88
}
89
89
90
90
const pkeyPath = joinPaths ( prefix , commonName + KEY_SUFFIX )
91
+ const tempPkeyPath = pkeyPath + '.tmp'
91
92
const csrPath = joinPaths ( prefix , commonName + CERTIFICATE_REQ_SUFFIX )
92
93
const certPath = joinPaths ( prefix , commonName + CERTIFICATE_SUFFIX )
93
94
@@ -168,8 +169,8 @@ async function clientAutoModeInternal(
168
169
csr . keys . privateKey
169
170
) ) as ArrayBuffer
170
171
pkeyPem = toPEM ( privKey , 'PRIVATE KEY' )
171
- fs . writeFileSync ( pkeyPath , pkeyPem )
172
- log . info ( `Wrote private key to ${ pkeyPath } ` )
172
+ fs . writeFileSync ( tempPkeyPath , pkeyPem )
173
+ log . info ( `Wrote private key to ${ tempPkeyPath } ` )
173
174
174
175
const challengePath = acmeChallengeDir ( r )
175
176
@@ -204,6 +205,8 @@ async function clientAutoModeInternal(
204
205
certInfo = await readCertificateInfo ( certificatePem )
205
206
fs . writeFileSync ( certPath , certificatePem )
206
207
log . info ( `Wrote certificate to ${ certPath } ` )
208
+ fs . renameSync ( tempPkeyPath , pkeyPath )
209
+ log . info ( `Renamed ${ tempPkeyPath } to ${ pkeyPath } ` )
207
210
208
211
// Purge the cert/key in the shared dict zone if applicable
209
212
purgeCachedCertKey ( r )
You can’t perform that action at this time.
0 commit comments