Skip to content

Commit

Permalink
fix: 创建CA机构生成的应为证书而非证书签名请求 (1Panel-dev#6404)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anyexyz authored Sep 7, 2024
1 parent a53fff2 commit 4666178
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/app/service/website_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/website/ssl/ca/detail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 4666178

Please sign in to comment.