feat(tls): add ocspStapling to certificate config

Expose the OCSP Stapling refresh interval (seconds) on the TLS
certificate object in the inbound security form, defaulting to 3600s
to match xray-core. Covers both file-backed and inline cert shapes.
This commit is contained in:
MHSanaei committed 2026-06-03 17:49:36 +02:00 Unverified
1 parent 55d6729955
commit 1a64d7e9de
5 files changed
+17 -1

No files matched your search

@@ -1,5 +1,5 @@
import { useTranslation } from 'react-i18next';
import { Button, Form, Input, Radio, Select, Space, Switch } from 'antd';
import { Button, Form, Input, InputNumber, Radio, Select, Space, Switch } from 'antd';
import { MinusOutlined, PlusOutlined, ReloadOutlined } from '@ant-design/icons';
import {
@@ -113,6 +113,7 @@ export default function TlsForm({
keyFile: '',
certificate: [],
key: [],
ocspStapling: 3600,
oneTimeLoading: false,
usage: 'encipherment',
buildChain: false,
@@ -218,6 +219,12 @@ export default function TlsForm({
);
}}
</Form.Item>
<Form.Item
name={[certField.name, 'ocspStapling']}
label="OCSP Stapling"
>
<InputNumber min={0} addonAfter="s" style={{ width: '50%' }} />
</Form.Item>
<Form.Item
name={[certField.name, 'oneTimeLoading']}
label={t('pages.inbounds.form.oneTimeLoading')}
@@ -167,6 +167,7 @@ export function useSecurityActions({ form, setSaving, messageApi, nodeId }: UseS
keyFile: '',
certificate: [],
key: [],
ocspStapling: 3600,
oneTimeLoading: false,
usage: 'encipherment',
buildChain: false,
@@ -34,6 +34,7 @@ export type TlsCertUsage = z.infer<typeof TlsCertUsageSchema>;
export const TlsCertFileSchema = z.object({
certificateFile: z.string().min(1),
keyFile: z.string().min(1),
ocspStapling: z.number().default(3600),
oneTimeLoading: z.boolean().default(false),
usage: TlsCertUsageSchema.default('encipherment'),
buildChain: z.boolean().default(false),
@@ -41,6 +42,7 @@ export const TlsCertFileSchema = z.object({
export const TlsCertInlineSchema = z.object({
certificate: z.array(z.string()),
key: z.array(z.string()),
ocspStapling: z.number().default(3600),
oneTimeLoading: z.boolean().default(false),
usage: TlsCertUsageSchema.default('encipherment'),
buildChain: z.boolean().default(false),
Loaded 3 of 5 files, more files were not shown because too many files have changed in this diff. Show more