优化代码/创建服务的时候可以保存SSL证书信息

This commit is contained in:
刘祥超
2020-12-18 21:18:35 +08:00
parent 563315c218
commit d6ad7f399d
31 changed files with 212 additions and 117 deletions

View File

@@ -104,18 +104,18 @@ func (this *UpdateHTTPSPopupAction) RunPost(params struct {
// 保存证书到本地
if len(certIds) > 0 && certIds[0] != 0 {
certResp, err := this.RPC().SSLCertRPC().FindEnabledSSLCertConfig(this.AdminContext(), &pb.FindEnabledSSLCertConfigRequest{
CertId: certIds[0],
SslCertId: certIds[0],
})
if err != nil {
this.ErrorPage(err)
return
}
if len(certResp.CertJSON) == 0 {
if len(certResp.SslCertJSON) == 0 {
this.Fail("选择的证书已失效,请换一个")
}
certConfig := &sslconfigs.SSLCertConfig{}
err = json.Unmarshal(certResp.CertJSON, certConfig)
err = json.Unmarshal(certResp.SslCertJSON, certConfig)
if err != nil {
this.ErrorPage(err)
return