Skip to content

Commit 2996a02

Browse files
alina.dmitrievanatalia.astashenko
authored andcommitted
FEATURE Added ability to get Ecdsa Root CA content
1 parent 19d404e commit 2996a02

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

wfe2/wfe.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const (
7575

7676
// Plesk
7777
caRootPath = "/ca-root"
78+
caEcdsaRootPath = "/ca-ecdsa-root"
7879
)
7980

8081
const (
@@ -433,6 +434,7 @@ func (wfe *WebFrontEndImpl) Handler(stats prometheus.Registerer, oTelHTTPOptions
433434

434435
// Plesk
435436
wfe.HandleFunc(m, caRootPath, wfe.CARoot, "GET")
437+
wfe.HandleFunc(m, caEcdsaRootPath, wfe.CAEcdsaRoot, "GET")
436438

437439
// Endpoint for draft-ietf-acme-ari
438440
if features.Get().ServeRenewalInfo {
@@ -513,6 +515,24 @@ func (wfe *WebFrontEndImpl) CARoot(
513515
response.Write(caRoot)
514516
}
515517

518+
// CAEcdsaRoot returns ecdsa Root CA content
519+
func (wfe *WebFrontEndImpl) CAEcdsaRoot(
520+
ctx context.Context,
521+
logEvent *web.RequestEvent,
522+
response http.ResponseWriter,
523+
request *http.Request) {
524+
filePath := "test/certs/webpki/root-ecdsa.cert.pem"
525+
caEcdsaRoot, err := ioutil.ReadFile(filePath)
526+
527+
if err != nil {
528+
prob := probs.ServerInternal(fmt.Sprintf("could not get ecdsa root ca: %v", err))
529+
wfe.sendError(response, logEvent, prob, nil)
530+
return
531+
}
532+
533+
response.Write(caEcdsaRoot)
534+
}
535+
516536
// Directory is an HTTP request handler that provides the directory
517537
// object stored in the WFE's DirectoryEndpoints member with paths prefixed
518538
// using the `request.Host` of the HTTP request.

0 commit comments

Comments
 (0)