Skip to content

Commit 9dc06a2

Browse files
committed
fix typos
1 parent 142a11a commit 9dc06a2

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

docs/api/_index.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ Replace the TLS certificate and key on the fly. Reload is optional.
199199

200200
The certificates need to be base64 encoded as in the following example.
201201

202-
When updating the TLS certificate with a new certificate obtained by requesting a Certificate Signing Request (CSR) from the CSR Endpoint, the keydata field must be omitted. The certificate will only be updated if the public key associated with the new certificate matches the public key generated by the CSR Endpoint.
202+
When updating the TLS certificate with a new certificate obtained by requesting a Certificate Signing Request (CSR) from
203+
the CSR endpoint, the keydata field must be omitted. The certificate will only be updated if the public key associated
204+
with the new certificate matches the public key generated by the CSR endpoint.
203205

204206
Example:
205207

@@ -225,13 +227,15 @@ Example:
225227

226228
```bash
227229
curl \
228-
-u user:changeme \
229-
-d '{"Country":"DE","State":"Bavaria","Locality":"Earth","Organization":"snclient","OrganizationalUnit":"IT","HostName":"Root CA SNClient", "NewKey":true, "KeyLength":4096}' \
230-
https://127.0.0.1:8443/api/v1/admin/csr
230+
-u user:changeme \
231+
-d '{"Country":"DE","State":"Bavaria","Locality":"Earth","Organization":"snclient","OrganizationalUnit":"IT","HostName":"Root CA SNClient", "NewKey":true, "KeyLength":4096}' \
232+
https://127.0.0.1:8443/api/v1/admin/csr
231233
```
232234

233235
Returns PEM encoded csr
234-
When NewKey:true is specified, a new private key will be generated and stored in a temporary file. This temporary file will be retained until you upload the signed certificate to the /api/v1/admin/certs/replace endpoint, at which point the new private key will be saved in the keyfile specified in the configuration
236+
When NewKey:true is specified, a new private key will be generated and stored in a temporary file. This temporary file
237+
will be retained until you upload the signed certificate to the /api/v1/admin/certs/replace endpoint, at which point the
238+
new private key will be saved in the keyfile specified in the configuration
235239

236240
### /api/v1/admin/updates/install
237241

pkg/snclient/listen_web_admin.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func (l *HandlerWebAdmin) serveCertsReplace(res http.ResponseWriter, req *http.R
306306
return
307307
}
308308

309-
certBytes, keyBytes, err := l.getBytesFromRaplacementStructData(res, data)
309+
certBytes, keyBytes, err := l.getBytesFromReplacementStructData(res, data)
310310
if err != nil {
311311
return
312312
}
@@ -359,7 +359,7 @@ func (l *HandlerWebAdmin) serveCertsReplace(res http.ResponseWriter, req *http.R
359359
}
360360
}
361361

362-
func (l *HandlerWebAdmin) getBytesFromRaplacementStructData(res http.ResponseWriter, data replaceCertData) (certBytes, keyBytes []byte, err error) {
362+
func (l *HandlerWebAdmin) getBytesFromReplacementStructData(res http.ResponseWriter, data replaceCertData) (certBytes, keyBytes []byte, err error) {
363363
if data.CertData != "" {
364364
certBytes, err = base64.StdEncoding.DecodeString(data.CertData)
365365
if err != nil {
@@ -383,7 +383,6 @@ func (l *HandlerWebAdmin) getBytesFromRaplacementStructData(res http.ResponseWri
383383

384384
func (l *HandlerWebAdmin) getRelevantPublicKeys(res http.ResponseWriter, tempKeyFile string, certBytes []byte) (privateKeyPubclicPart, certPublicKey *rsa.PublicKey) {
385385
newPrivateKey, err := l.readPrivateKey(tempKeyFile)
386-
387386
if err != nil {
388387
l.sendError(res, err)
389388
}

0 commit comments

Comments
 (0)