mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix: wildcard certificate challenge method not present
This commit is contained in:
parent
f727218a28
commit
97ec26331b
4 changed files with 46 additions and 4 deletions
|
@ -123,6 +123,8 @@ func IssueCert(c *gin.Context) {
|
|||
SSLCertificateKeyPath: sslCertificateKeyPath,
|
||||
AutoCert: model.AutoCertEnabled,
|
||||
KeyType: payload.KeyType,
|
||||
ChallengeMethod: payload.ChallengeMethod,
|
||||
DnsCredentialID: payload.DNSCredentialID,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -23,6 +23,7 @@ function open() {
|
|||
step.value = 0
|
||||
data.value = {
|
||||
challenge_method: 'dns01',
|
||||
key_type: '2048',
|
||||
} as Cert
|
||||
}
|
||||
|
||||
|
@ -45,12 +46,39 @@ const issueCert = () => {
|
|||
modalVisible.value = true
|
||||
|
||||
refObtainCertLive.value.issue_cert(computedDomain.value,
|
||||
[computedDomain.value, domain.value])
|
||||
[computedDomain.value, domain.value], data.value.key_type)
|
||||
.then(() => {
|
||||
message.success($gettext('Renew successfully'))
|
||||
emit('issued')
|
||||
})
|
||||
}
|
||||
|
||||
const keyType = shallowRef([
|
||||
{
|
||||
key: '2048',
|
||||
name: 'RSA2048',
|
||||
},
|
||||
{
|
||||
key: '3072',
|
||||
name: 'RSA3072',
|
||||
},
|
||||
{
|
||||
key: '4096',
|
||||
name: 'RSA4096',
|
||||
},
|
||||
{
|
||||
key: '8192',
|
||||
name: 'RAS8192',
|
||||
},
|
||||
{
|
||||
key: 'P256',
|
||||
name: 'EC256',
|
||||
},
|
||||
{
|
||||
key: 'P384',
|
||||
name: 'EC384',
|
||||
},
|
||||
])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -75,6 +103,18 @@ const issueCert = () => {
|
|||
addon-before="*."
|
||||
/>
|
||||
</AFormItem>
|
||||
|
||||
<AFormItem :label="$gettext('Key Type')">
|
||||
<ASelect v-model:value="data.key_type">
|
||||
<ASelectOption
|
||||
v-for="t in keyType"
|
||||
:key="t.key"
|
||||
:value="t.key"
|
||||
>
|
||||
{{ t.name }}
|
||||
</ASelectOption>
|
||||
</ASelect>
|
||||
</AFormItem>
|
||||
</AForm>
|
||||
<div
|
||||
v-if="step === 0"
|
||||
|
|
|
@ -44,8 +44,8 @@ const keyType = shallowRef([
|
|||
])
|
||||
|
||||
onMounted(() => {
|
||||
if (data.value.key_type === '')
|
||||
data.value.key_type = 'RSA2048'
|
||||
if (!data.value.key_type)
|
||||
data.value.key_type = '2048'
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
func autoCertKeyType(fl val.FieldLevel) bool {
|
||||
switch certcrypto.KeyType(fl.Field().String()) {
|
||||
case certcrypto.RSA2048, certcrypto.RSA3072, certcrypto.RSA4096,
|
||||
case "", certcrypto.RSA2048, certcrypto.RSA3072, certcrypto.RSA4096,
|
||||
certcrypto.EC256, certcrypto.EC384:
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue