Skip to content

Commit

Permalink
Create a privkey for registry
Browse files Browse the repository at this point in the history
  • Loading branch information
jhiemstrawisc authored and bbockelm committed Sep 5, 2023
1 parent f7cdd52 commit 73018d9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/namespace_registry_serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@
package main

import (
"crypto/elliptic"
"github.com/pkg/errors"
"os"
"os/signal"
"syscall"

"github.com/pelicanplatform/pelican/config"
"github.com/pelicanplatform/pelican/namespace-registry"
"github.com/pelicanplatform/pelican/web_ui"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

func serveNamespaceRegistry( /*cmd*/ *cobra.Command /*args*/, []string) error {
Expand All @@ -45,6 +48,12 @@ func serveNamespaceRegistry( /*cmd*/ *cobra.Command /*args*/, []string) error {
return errors.Wrap(err, "Failed to generate TLS certificate")
}

// The registry needs its own private key. If one doesn't exist, this will generate it
issuerKeyFile := viper.GetString("IssuerKey")
err = config.GeneratePrivateKey(issuerKeyFile, elliptic.P521())
if err != nil {
return errors.Wrap(err, "Failed to generate registry private key")
}
engine, err := web_ui.GetEngine()
if err != nil {
return err
Expand Down

0 comments on commit 73018d9

Please sign in to comment.