feat: Allow to change SSL verify in HTTP Node (#22052)

Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
Davide Delbianco 2025-07-09 09:53:24 +02:00 committed by GitHub
parent 89b52471fb
commit 1885426421
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 106 additions and 1 deletions

View File

@ -101,7 +101,7 @@ const Tooltip: FC<TooltipProps> = ({
>
{popupContent && (<div
className={cn(
!noDecoration && 'system-xs-regular relative break-words rounded-md bg-components-panel-bg px-3 py-2 text-text-tertiary shadow-lg',
!noDecoration && 'system-xs-regular relative max-w-[300px] break-words rounded-md bg-components-panel-bg px-3 py-2 text-left text-text-tertiary shadow-lg',
popupClassName,
)}
onMouseEnter={() => triggerMethod === 'hover' && setHoverPopup()}

View File

@ -22,6 +22,7 @@ const nodeDefault: NodeDefault<HttpNodeType> = {
type: BodyType.none,
data: [],
},
ssl_verify: true,
timeout: {
max_connect_timeout: 0,
max_read_timeout: 0,

View File

@ -10,6 +10,7 @@ import type { HttpNodeType } from './types'
import Timeout from './components/timeout'
import CurlPanel from './components/curl-panel'
import cn from '@/utils/classnames'
import Switch from '@/app/components/base/switch'
import Field from '@/app/components/workflow/nodes/_base/components/field'
import Split from '@/app/components/workflow/nodes/_base/components/split'
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
@ -47,6 +48,7 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
showCurlPanel,
hideCurlPanel,
handleCurlImport,
handleSSLVerifyChange,
} = useConfig(id, data)
// To prevent prompt editor in body not update data.
if (!isDataReady)
@ -124,6 +126,18 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
onChange={setBody}
/>
</Field>
<Field
title={t(`${i18nPrefix}.verifySSL.title`)}
tooltip={t(`${i18nPrefix}.verifySSL.warningTooltip`)}
operations={
<Switch
defaultValue={!!inputs.ssl_verify}
onChange={handleSSLVerifyChange}
size='md'
disabled={readOnly}
/>
}>
</Field>
</div>
<Split />
<Timeout

View File

@ -81,4 +81,5 @@ export type HttpNodeType = CommonNodeType & {
body: Body
authorization: Authorization
timeout: Timeout
ssl_verify?: boolean
}

View File

@ -141,6 +141,13 @@ const useConfig = (id: string, payload: HttpNodeType) => {
setInputs(newInputs)
}, [inputs, setInputs])
const handleSSLVerifyChange = useCallback((checked: boolean) => {
const newInputs = produce(inputs, (draft: HttpNodeType) => {
draft.ssl_verify = checked
})
setInputs(newInputs)
}, [inputs, setInputs])
return {
readOnly,
isDataReady,
@ -164,6 +171,8 @@ const useConfig = (id: string, payload: HttpNodeType) => {
toggleIsParamKeyValueEdit,
// body
setBody,
// ssl verify
handleSSLVerifyChange,
// authorization
isShowAuthorization,
showAuthorization,

View File

@ -539,6 +539,10 @@ const translation = {
title: 'Importieren von cURL',
placeholder: 'Fügen Sie hier die cURL-Zeichenfolge ein',
},
verifySSL: {
title: 'SSL-Zertifikat überprüfen',
warningTooltip: 'Das Deaktivieren der SSL-Überprüfung wird für Produktionsumgebungen nicht empfohlen. Dies sollte nur in der Entwicklung oder im Test verwendet werden, da es die Verbindung anfällig für Sicherheitsbedrohungen wie Man-in-the-Middle-Angriffe macht.',
},
},
code: {
inputVars: 'Eingabevariablen',

View File

@ -544,6 +544,10 @@ const translation = {
title: 'Import from cURL',
placeholder: 'Paste cURL string here',
},
verifySSL: {
title: 'Verify SSL Certificate',
warningTooltip: 'Disabling SSL verification is not recommended for production environments. This should only be used in development or testing, as it makes the connection vulnerable to security threats like man-in-the-middle attacks.',
},
},
code: {
inputVars: 'Input Variables',

View File

@ -537,6 +537,10 @@ const translation = {
title: 'Importar desde cURL',
placeholder: 'Pegar la cadena cURL aquí',
},
verifySSL: {
title: 'Verificar el certificado SSL',
warningTooltip: 'Deshabilitar la verificación SSL no se recomienda para entornos de producción. Esto solo debe utilizarse en desarrollo o pruebas, ya que hace que la conexión sea vulnerable a amenazas de seguridad como ataques de intermediario.',
},
},
code: {
inputVars: 'Variables de entrada',

View File

@ -539,6 +539,10 @@ const translation = {
title: 'وارد کردن از cURL',
placeholder: 'رشته cURL را اینجا بچسبانید',
},
verifySSL: {
title: 'گواهی SSL را تأیید کنید',
warningTooltip: 'غیرفعال کردن تأیید SSL برای محیط‌های تولید توصیه نمی‌شود. این فقط باید در توسعه یا آزمایش استفاده شود، زیرا این کار اتصال را در معرض تهدیدات امنیتی مانند حملات میانی قرار می‌دهد.',
},
},
code: {
inputVars: 'متغیرهای ورودی',

View File

@ -539,6 +539,10 @@ const translation = {
placeholder: 'Collez la chaîne cURL ici',
title: 'Importer à partir de cURL',
},
verifySSL: {
title: 'Vérifier le certificat SSL',
warningTooltip: 'Désactiver la vérification SSL n\'est pas recommandé pour les environnements de production. Cela ne devrait être utilisé que dans le développement ou les tests, car cela rend la connexion vulnérable aux menaces de sécurité telles que les attaques de type \'man-in-the-middle\'.',
},
},
code: {
inputVars: 'Variables de saisie',

View File

@ -552,6 +552,10 @@ const translation = {
placeholder: 'यहां cURL स्ट्रिंग पेस्ट करें',
title: 'cURL से आयात करें',
},
verifySSL: {
title: 'SSL प्रमाणपत्र की पुष्टि करें',
warningTooltip: 'SSL सत्यापन को अक्षम करना उत्पादन वातावरण के लिए अनुशंसित नहीं है। इसका उपयोग केवल विकास या परीक्षण में किया जाना चाहिए, क्योंकि यह कनेक्शन को मिडल-मैन हमलों जैसे सुरक्षा खतरों के लिए कमजोर बना देता है।',
},
},
code: {
inputVars: 'इनपुट वेरिएबल्स',

View File

@ -555,6 +555,10 @@ const translation = {
placeholder: 'Incolla qui la stringa cURL',
title: 'Importazione da cURL',
},
verifySSL: {
title: 'Verifica il certificato SSL',
warningTooltip: 'Disabilitare la verifica SSL non è raccomandato per gli ambienti di produzione. Questo dovrebbe essere utilizzato solo in sviluppo o test, poiché rende la connessione vulnerabile a minacce alla sicurezza come gli attacchi man-in-the-middle.',
},
},
code: {
inputVars: 'Variabili di Input',

View File

@ -545,6 +545,10 @@ const translation = {
title: 'cURL からインポート',
placeholder: 'ここに cURL 文字列を貼り付けます',
},
verifySSL: {
title: 'SSL証明書を確認する',
warningTooltip: 'SSL検証を無効にすることは、本番環境では推奨されません。これは開発またはテストのみに使用すべきであり、中間者攻撃などのセキュリティ脅威に対して接続を脆弱にするためです。',
},
},
code: {
inputVars: '入力変数',

View File

@ -567,6 +567,10 @@ const translation = {
title: 'cURL 에서 가져오기',
placeholder: '여기에 cURL 문자열 붙여 넣기',
},
verifySSL: {
title: 'SSL 인증서 확인',
warningTooltip: 'SSL 검증을 비활성화하는 것은 프로덕션 환경에서는 권장되지 않습니다. 이는 연결이 중간자 공격과 같은 보안 위협에 취약하게 만들므로 개발 또는 테스트에서만 사용해야 합니다.',
},
},
code: {
inputVars: '입력 변수',

View File

@ -539,6 +539,10 @@ const translation = {
placeholder: 'Wklej tutaj ciąg cURL',
title: 'Importowanie z cURL',
},
verifySSL: {
title: 'Zweryfikuj certyfikat SSL',
warningTooltip: 'Wyłączenie weryfikacji SSL nie jest zalecane w środowiskach produkcyjnych. Powinno to być używane tylko w rozwoju lub testowaniu, ponieważ naraża połączenie na zagrożenia bezpieczeństwa, takie jak ataki typu man-in-the-middle.',
},
},
code: {
inputVars: 'Zmienne wejściowe',

View File

@ -539,6 +539,10 @@ const translation = {
placeholder: 'Cole a string cURL aqui',
title: 'Importar do cURL',
},
verifySSL: {
title: 'Verificar o certificado SSL',
warningTooltip: 'Desabilitar a verificação SSL não é recomendado para ambientes de produção. Isso deve ser usado apenas em desenvolvimento ou teste, pois torna a conexão vulnerável a ameaças de segurança, como ataques man-in-the-middle.',
},
},
code: {
inputVars: 'Variáveis de entrada',

View File

@ -539,6 +539,10 @@ const translation = {
placeholder: 'Lipiți șirul cURL aici',
title: 'Importați din cURL',
},
verifySSL: {
title: 'Verifică certificatul SSL',
warningTooltip: 'Dezactivarea verificării SSL nu este recomandată pentru medii de producție. Acest lucru ar trebui să fie folosit doar în dezvoltare sau testare, deoarece face conexiunea vulnerabilă la amenințări de securitate, cum ar fi atacurile man-in-the-middle.',
},
},
code: {
inputVars: 'Variabile de intrare',

View File

@ -539,6 +539,10 @@ const translation = {
placeholder: 'Вставьте сюда строку cURL',
title: 'Импорт из cURL',
},
verifySSL: {
title: 'Проверить SSL-сертификат',
warningTooltip: 'Отключение проверки SSL не рекомендуется для производственных сред. Это следует использовать только в разработке или тестировании, так как это делает соединение уязвимым для угроз безопасности, таких как атаки «человек посередине».',
},
},
code: {
inputVars: 'Входные переменные',

View File

@ -541,6 +541,10 @@ const translation = {
value: 'Vrednost',
params: 'Parametri',
insertVarPlaceholder: 'vnesite \'/\' za vstavljanje spremenljivke',
verifySSL: {
title: 'Preverite SSL certifikat',
warningTooltip: 'Onemogočanje preverjanja SSL ni priporočljivo za proizvodna okolja. To bi se moralo uporabljati le pri razvoju ali testiranju, saj povezavo izpostavi varnostnim grožnjam, kot so napadi človek-v-sredini.',
},
},
code: {
searchDependencies: 'Išči odvisnosti',

View File

@ -539,6 +539,10 @@ const translation = {
title: 'นําเข้าจาก cURL',
placeholder: 'วางสตริง cURL ที่นี่',
},
verifySSL: {
title: 'ตรวจสอบใบรับรอง SSL',
warningTooltip: 'การปิดการตรวจสอบ SSL ไม่แนะนำให้ใช้ในสภาพแวดล้อมการผลิต ควรใช้เฉพาะในระหว่างการพัฒนาหรือการทดสอบเท่านั้น เนื่องจากจะทำให้การเชื่อมต่อมีความเสี่ยงต่อภัยคุกคามด้านความปลอดภัย เช่น การโจมตีแบบ Man-in-the-middle.',
},
},
code: {
inputVars: 'ตัวแปรอินพุต',

View File

@ -540,6 +540,10 @@ const translation = {
placeholder: 'cURL dizesini buraya yapıştırın',
title: 'cURL\'den içe aktar',
},
verifySSL: {
title: 'SSL Sertifikasını Doğrula',
warningTooltip: 'SSL doğrulamasını devre dışı bırakmak, üretim ortamları için önerilmez. Bu yalnızca geliştirme veya test aşamalarında kullanılmalıdır, çünkü bağlantıyı adam ortada saldırıları gibi güvenlik tehditlerine karşı savunmasız hale getirir.',
},
},
code: {
inputVars: 'Giriş Değişkenleri',

View File

@ -539,6 +539,10 @@ const translation = {
title: 'Імпорт з cURL',
placeholder: 'Вставте сюди рядок cURL',
},
verifySSL: {
title: 'Перевірити SSL сертифікат',
warningTooltip: 'Вимкнення перевірки SSL не рекомендується для виробничих середовищ. Це слід використовувати лише в розробці або тестуванні, оскільки це робить з\'єднання вразливим до загроз безпеці, таких як атаки «людина посередині».',
},
},
code: {
inputVars: 'Вхідні змінні',

View File

@ -539,6 +539,10 @@ const translation = {
title: 'Nhập từ cURL',
placeholder: 'Dán chuỗi cURL vào đây',
},
verifySSL: {
title: 'Xác thực chứng chỉ SSL',
warningTooltip: 'Việc vô hiệu hóa xác minh SSL không được khuyến khích cho các môi trường sản xuất. Điều này chỉ nên được sử dụng trong phát triển hoặc thử nghiệm, vì nó làm cho kết nối dễ bị tổn thương trước các mối đe dọa an ninh như cuộc tấn công man-in-the-middle.',
},
},
code: {
inputVars: 'Biến đầu vào',

View File

@ -545,6 +545,10 @@ const translation = {
title: '导入 cURL',
placeholder: '粘贴 cURL 字符串',
},
verifySSL: {
title: '验证 SSL 证书',
warningTooltip: '不建议在生产环境中禁用 SSL 验证。这仅应在开发或测试中使用,因为它会使连接容易受到诸如中间人攻击等安全威胁。',
},
},
code: {
inputVars: '输入变量',

View File

@ -539,6 +539,10 @@ const translation = {
placeholder: '在此處粘貼 cURL 字串',
title: '從 cURL 導入',
},
verifySSL: {
title: '驗證 SSL 證書',
warningTooltip: '不建議在生產環境中禁用SSL驗證。這僅應用於開發或測試因為這樣會使連接容易受到中間人攻擊等安全威脅的威脅。',
},
},
code: {
inputVars: '輸入變量',