diff --git a/authority/authority.go b/authority/authority.go index c5f8c3a6..8c5eb9c4 100644 --- a/authority/authority.go +++ b/authority/authority.go @@ -85,6 +85,7 @@ type AuthorityInfo struct { RootX509Certs []*x509.Certificate SSHCAUserPublicKey []byte SSHCAHostPublicKey []byte + DNSNames []string } // New creates and initiates a new Authority type. @@ -570,6 +571,7 @@ func (a *Authority) GetInfo() AuthorityInfo { ai := AuthorityInfo{ StartTime: a.startTime, RootX509Certs: a.rootX509Certs, + DNSNames: a.config.DNSNames, } if a.sshCAUserCertSignKey != nil { ai.SSHCAUserPublicKey = ssh.MarshalAuthorizedKey(a.sshCAUserCertSignKey.PublicKey()) diff --git a/ca/ca.go b/ca/ca.go index 185fb72e..89813d64 100644 --- a/ca/ca.go +++ b/ca/ca.go @@ -1,15 +1,14 @@ package ca import ( - "crypto/sha256" "crypto/tls" "crypto/x509" - "encoding/hex" "fmt" "log" "net/http" "net/url" "reflect" + "strings" "sync" "github.com/go-chi/chi" @@ -28,6 +27,7 @@ import ( scepAPI "github.com/smallstep/certificates/scep/api" "github.com/smallstep/certificates/server" "github.com/smallstep/nosql" + "go.step.sm/crypto/x509util" ) type options struct { @@ -300,12 +300,19 @@ func (ca *CA) Run() error { if !ca.opts.quiet { authorityInfo := ca.auth.GetInfo() - log.Printf("Address: %s", ca.config.Address) + log.Printf("Welcome to step-ca.") + log.Printf("The primary server URL is https://%s%s", + authorityInfo.DNSNames[0], + ca.config.Address[strings.LastIndex(ca.config.Address, ":"):]) + if len(authorityInfo.DNSNames) > 1 { + log.Printf("Additional configured hostnames: %s", + strings.Join(authorityInfo.DNSNames[1:], ", ")) + } for _, crt := range authorityInfo.RootX509Certs { log.Printf("X.509 Root Fingerprint: %s", x509util.Fingerprint(crt)) } if authorityInfo.SSHCAHostPublicKey != nil { - log.Printf("SSH Host CA Key: %s\n", authorityInfo.SSHCAHostPublicKey) + log.Printf("SSH Host CA Key is %s\n", authorityInfo.SSHCAHostPublicKey) } if authorityInfo.SSHCAUserPublicKey != nil { log.Printf("SSH User CA Key: %s\n", authorityInfo.SSHCAUserPublicKey)