fix: 创建CA机构生成的应为证书而非证书签名请求 (#6404)

This commit is contained in:
Anye 2024-09-07 21:56:38 +08:00 committed by GitHub
parent a53fff2416
commit 466617847f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -432,14 +432,14 @@ func (w WebsiteCAService) DownloadFile(id uint) (*os.File, error) {
if err = fileOp.CreateDir(dir, 0666); err != nil {
return nil, err
}
if err = fileOp.WriteFile(path.Join(dir, "ca.csr"), strings.NewReader(ca.CSR), 0644); err != nil {
if err = fileOp.WriteFile(path.Join(dir, "ca.crt"), strings.NewReader(ca.CSR), 0644); err != nil {
return nil, err
}
if err = fileOp.WriteFile(path.Join(dir, "private.key"), strings.NewReader(ca.PrivateKey), 0644); err != nil {
if err = fileOp.WriteFile(path.Join(dir, "ca.key"), strings.NewReader(ca.PrivateKey), 0644); err != nil {
return nil, err
}
fileName := ca.Name + ".zip"
if err = fileOp.Compress([]string{path.Join(dir, "ca.csr"), path.Join(dir, "private.key")}, dir, fileName, files.SdkZip, ""); err != nil {
if err = fileOp.Compress([]string{path.Join(dir, "ca.crt"), path.Join(dir, "ca.key")}, dir, fileName, files.SdkZip, ""); err != nil {
return nil, err
}
return os.Open(path.Join(dir, fileName))

View File

@ -6,7 +6,7 @@
<div v-loading="loading">
<el-radio-group v-model="curr">
<el-radio-button value="detail">{{ $t('ssl.organizationDetail') }}</el-radio-button>
<el-radio-button value="ssl">csr</el-radio-button>
<el-radio-button value="ssl">{{ $t('ssl.ssl') }}</el-radio-button>
<el-radio-button value="key">{{ $t('ssl.key') }}</el-radio-button>
</el-radio-group>
<div v-if="curr === 'detail'" class="mt-5">