diff --git a/src/http.go b/src/http.go index 6763346..d5dc954 100644 --- a/src/http.go +++ b/src/http.go @@ -79,12 +79,24 @@ func getCert(c *gin.Context) { } key := string(keyContent) + certInfoFilePath := path.Join(dir, CertInfoFileName) + certInfoContent, err := os.ReadFile(certInfoFilePath) + if err != nil { + c.JSON(200, gin.H{ + "code": 500, + "msg": "Failed to read cert info file.", + }) + return + } + certInfo := string(certInfoContent) + c.JSON(200, gin.H{ "code": 200, "msg": "Success", "data": gin.H{ - "crt": encryptResult(crt, token), - "key": encryptResult(key, token), + "crt": encryptResult(crt, token), + "key": encryptResult(key, token), + "info": encryptResult(certInfo, token), }, }) }