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