list
This commit is contained in:
parent
4429072e0c
commit
5cf96d8ab3
16
src/http.go
16
src/http.go
|
@ -79,12 +79,24 @@ func getCert(c *gin.Context) {
|
||||||
}
|
}
|
||||||
key := string(keyContent)
|
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{
|
c.JSON(200, gin.H{
|
||||||
"code": 200,
|
"code": 200,
|
||||||
"msg": "Success",
|
"msg": "Success",
|
||||||
"data": gin.H{
|
"data": gin.H{
|
||||||
"crt": encryptResult(crt, token),
|
"crt": encryptResult(crt, token),
|
||||||
"key": encryptResult(key, token),
|
"key": encryptResult(key, token),
|
||||||
|
"info": encryptResult(certInfo, token),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user