Skip to content

Commit 97ec263

Browse files
committed
fix: wildcard certificate challenge method not present
1 parent f727218 commit 97ec263

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed

api/certificate/issue.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ func IssueCert(c *gin.Context) {
123123
SSLCertificateKeyPath: sslCertificateKeyPath,
124124
AutoCert: model.AutoCertEnabled,
125125
KeyType: payload.KeyType,
126+
ChallengeMethod: payload.ChallengeMethod,
127+
DnsCredentialID: payload.DNSCredentialID,
126128
})
127129

128130
if err != nil {

app/src/views/certificate/WildcardCertificate.vue

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function open() {
2323
step.value = 0
2424
data.value = {
2525
challenge_method: 'dns01',
26+
key_type: '2048',
2627
} as Cert
2728
}
2829
@@ -45,12 +46,39 @@ const issueCert = () => {
4546
modalVisible.value = true
4647
4748
refObtainCertLive.value.issue_cert(computedDomain.value,
48-
[computedDomain.value, domain.value])
49+
[computedDomain.value, domain.value], data.value.key_type)
4950
.then(() => {
5051
message.success($gettext('Renew successfully'))
5152
emit('issued')
5253
})
5354
}
55+
56+
const keyType = shallowRef([
57+
{
58+
key: '2048',
59+
name: 'RSA2048',
60+
},
61+
{
62+
key: '3072',
63+
name: 'RSA3072',
64+
},
65+
{
66+
key: '4096',
67+
name: 'RSA4096',
68+
},
69+
{
70+
key: '8192',
71+
name: 'RAS8192',
72+
},
73+
{
74+
key: 'P256',
75+
name: 'EC256',
76+
},
77+
{
78+
key: 'P384',
79+
name: 'EC384',
80+
},
81+
])
5482
</script>
5583

5684
<template>
@@ -75,6 +103,18 @@ const issueCert = () => {
75103
addon-before="*."
76104
/>
77105
</AFormItem>
106+
107+
<AFormItem :label="$gettext('Key Type')">
108+
<ASelect v-model:value="data.key_type">
109+
<ASelectOption
110+
v-for="t in keyType"
111+
:key="t.key"
112+
:value="t.key"
113+
>
114+
{{ t.name }}
115+
</ASelectOption>
116+
</ASelect>
117+
</AFormItem>
78118
</AForm>
79119
<div
80120
v-if="step === 0"

app/src/views/domain/cert/components/AutoCertStepOne.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const keyType = shallowRef([
4444
])
4545
4646
onMounted(() => {
47-
if (data.value.key_type === '')
48-
data.value.key_type = 'RSA2048'
47+
if (!data.value.key_type)
48+
data.value.key_type = '2048'
4949
})
5050
</script>
5151

internal/validation/key_type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
func autoCertKeyType(fl val.FieldLevel) bool {
99
switch certcrypto.KeyType(fl.Field().String()) {
10-
case certcrypto.RSA2048, certcrypto.RSA3072, certcrypto.RSA4096,
10+
case "", certcrypto.RSA2048, certcrypto.RSA3072, certcrypto.RSA4096,
1111
certcrypto.EC256, certcrypto.EC384:
1212
return true
1313
}

0 commit comments

Comments
 (0)