|
|
@ -37,6 +37,8 @@ import (
|
|
|
|
"github.com/ThalesIgnite/crypto11"
|
|
|
|
"github.com/ThalesIgnite/crypto11"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"git.cacert.org/cacert-gosigner/pkg/messages"
|
|
|
|
|
|
|
|
|
|
|
|
"git.cacert.org/cacert-gosigner/internal/config"
|
|
|
|
"git.cacert.org/cacert-gosigner/internal/config"
|
|
|
|
"git.cacert.org/cacert-gosigner/internal/health"
|
|
|
|
"git.cacert.org/cacert-gosigner/internal/health"
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -68,7 +70,7 @@ func (a *Access) Healthy() (*health.Info, error) {
|
|
|
|
|
|
|
|
|
|
|
|
moreInfo := make(map[string]string)
|
|
|
|
moreInfo := make(map[string]string)
|
|
|
|
|
|
|
|
|
|
|
|
const checkFailed = "failed"
|
|
|
|
var checkFailed = messages.CertificateInfo{Status: "failed", Signing: false}.String()
|
|
|
|
|
|
|
|
|
|
|
|
for _, ca := range a.signerConfig.RootCAs() {
|
|
|
|
for _, ca := range a.signerConfig.RootCAs() {
|
|
|
|
infoKey := fmt.Sprintf("root-%s", ca)
|
|
|
|
infoKey := fmt.Sprintf("root-%s", ca)
|
|
|
@ -82,7 +84,12 @@ func (a *Access) Healthy() (*health.Info, error) {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
moreInfo[infoKey] = fmt.Sprintf("ok, valid until %s", cert.NotAfter.UTC().Format(time.RFC3339))
|
|
|
|
moreInfo[infoKey] = messages.CertificateInfo{
|
|
|
|
|
|
|
|
Status: "ok",
|
|
|
|
|
|
|
|
Signing: false,
|
|
|
|
|
|
|
|
Profiles: []messages.CAProfile{},
|
|
|
|
|
|
|
|
ValidUntil: cert.NotAfter.UTC(),
|
|
|
|
|
|
|
|
}.String()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for _, ca := range a.signerConfig.SubordinateCAs() {
|
|
|
|
for _, ca := range a.signerConfig.SubordinateCAs() {
|
|
|
@ -115,7 +122,12 @@ func (a *Access) Healthy() (*health.Info, error) {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
moreInfo[infoKey] = fmt.Sprintf("ok, valid until %s", cert.NotAfter.UTC().Format(time.RFC3339))
|
|
|
|
moreInfo[infoKey] = messages.CertificateInfo{
|
|
|
|
|
|
|
|
Status: "ok",
|
|
|
|
|
|
|
|
Signing: true,
|
|
|
|
|
|
|
|
Profiles: def.Profiles,
|
|
|
|
|
|
|
|
ValidUntil: cert.NotAfter.UTC(),
|
|
|
|
|
|
|
|
}.String()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return &health.Info{
|
|
|
|
return &health.Info{
|
|
|
|