new changes
parent
237e3d6b63
commit
3c63e473bd
|
@ -144,7 +144,8 @@ func GetCertificateInformationEncoded(c *gin.Context) {
|
||||||
"validationType": validationType,
|
"validationType": validationType,
|
||||||
"signatureAlgorithm": certificate.SignatureAlgorithm.String(),
|
"signatureAlgorithm": certificate.SignatureAlgorithm.String(),
|
||||||
"publicKeyAlgorithm": certificate.PublicKeyAlgorithm.String(),
|
"publicKeyAlgorithm": certificate.PublicKeyAlgorithm.String(),
|
||||||
"serialNumber": certificate.SerialNumber.Int64(),
|
"serialNumber": certificate.SerialNumber.String(),
|
||||||
|
"notBefore": certificate.NotBefore,
|
||||||
"notAfter": certificate.NotAfter,
|
"notAfter": certificate.NotAfter,
|
||||||
"keyUsage": keyUsages,
|
"keyUsage": keyUsages,
|
||||||
"keyUsageAsText": keyUsagesText,
|
"keyUsageAsText": keyUsagesText,
|
||||||
|
@ -183,6 +184,7 @@ func GetCertificateInfo(c *gin.Context) {
|
||||||
tlsVersion = "unknown"
|
tlsVersion = "unknown"
|
||||||
}
|
}
|
||||||
certificate := resp.ConnectionState().PeerCertificates[0]
|
certificate := resp.ConnectionState().PeerCertificates[0]
|
||||||
|
rootCertificate := resp.ConnectionState().PeerCertificates[len(resp.ConnectionState().PeerCertificates)-1]
|
||||||
|
|
||||||
var validationType string
|
var validationType string
|
||||||
for _, value := range certificate.PolicyIdentifiers {
|
for _, value := range certificate.PolicyIdentifiers {
|
||||||
|
@ -285,10 +287,18 @@ func GetCertificateInfo(c *gin.Context) {
|
||||||
"locality": certificate.Issuer.Locality,
|
"locality": certificate.Issuer.Locality,
|
||||||
"country": certificate.Issuer.Country,
|
"country": certificate.Issuer.Country,
|
||||||
},
|
},
|
||||||
|
"root": gin.H{
|
||||||
|
"commonName": rootCertificate.Issuer.CommonName,
|
||||||
|
"organization": rootCertificate.Issuer.Organization,
|
||||||
|
"organizationalUnit": rootCertificate.Issuer.OrganizationalUnit,
|
||||||
|
"locality": rootCertificate.Issuer.Locality,
|
||||||
|
"country": rootCertificate.Issuer.Country,
|
||||||
|
},
|
||||||
"validationType": validationType,
|
"validationType": validationType,
|
||||||
"signatureAlgorithm": certificate.SignatureAlgorithm.String(),
|
"signatureAlgorithm": certificate.SignatureAlgorithm.String(),
|
||||||
"publicKeyAlgorithm": certificate.PublicKeyAlgorithm.String(),
|
"publicKeyAlgorithm": certificate.PublicKeyAlgorithm.String(),
|
||||||
"serialNumber": certificate.SerialNumber.Int64(),
|
"serialNumber": certificate.SerialNumber.String(),
|
||||||
|
"notBefore": certificate.NotBefore,
|
||||||
"notAfter": certificate.NotAfter,
|
"notAfter": certificate.NotAfter,
|
||||||
"keyUsage": keyUsages,
|
"keyUsage": keyUsages,
|
||||||
"keyUsageAsText": keyUsagesText,
|
"keyUsageAsText": keyUsagesText,
|
||||||
|
|
Loading…
Reference in New Issue