tls_settings.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {{define "form/tlsSettings"}}
  2. <!-- tls enable -->
  3. <a-form v-if="inbound.canEnableTls()" :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
  4. <a-divider style="margin:3px 0;"></a-divider>
  5. <a-form-item label='{{ i18n "security" }}'>
  6. <a-radio-group v-model="inbound.stream.security" button-style="solid">
  7. <a-radio-button value="none">{{ i18n "none" }}</a-radio-button>
  8. <a-radio-button v-if="inbound.canEnableReality()" value="reality">Reality</a-radio-button>
  9. <a-radio-button value="tls">TLS</a-radio-button>
  10. </a-radio-group>
  11. </a-form-item>
  12. <!-- tls settings -->
  13. <template v-if="inbound.stream.isTls">
  14. <a-form-item label="SNI" placeholder="Server Name Indication">
  15. <a-input v-model.trim="inbound.stream.tls.sni"></a-input>
  16. </a-form-item>
  17. <a-form-item label="Cipher Suites">
  18. <a-select v-model="inbound.stream.tls.cipherSuites" :dropdown-class-name="themeSwitcher.currentTheme">
  19. <a-select-option value="">Auto</a-select-option>
  20. <a-select-option v-for="key,value in TLS_CIPHER_OPTION" :value="key">[[ value ]]</a-select-option>
  21. </a-select>
  22. </a-form-item>
  23. <a-form-item label="Min/Max Version">
  24. <a-input-group compact>
  25. <a-select v-model="inbound.stream.tls.minVersion" style="width: 50%"
  26. :dropdown-class-name="themeSwitcher.currentTheme">
  27. <a-select-option v-for="key in TLS_VERSION_OPTION" :value="key">[[ key ]]</a-select-option>
  28. </a-select>
  29. <a-select v-model="inbound.stream.tls.maxVersion" style="width: 50%"
  30. :dropdown-class-name="themeSwitcher.currentTheme">
  31. <a-select-option v-for="key in TLS_VERSION_OPTION" :value="key">[[ key ]]</a-select-option>
  32. </a-select>
  33. </a-input-group>
  34. </a-form-item>
  35. <a-form-item label="uTLS">
  36. <a-select v-model="inbound.stream.tls.settings.fingerprint" style="width: 50%"
  37. :dropdown-class-name="themeSwitcher.currentTheme">
  38. <a-select-option value=''>None</a-select-option>
  39. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  40. </a-select>
  41. </a-form-item>
  42. <a-form-item label="ALPN">
  43. <a-select mode="multiple" :dropdown-class-name="themeSwitcher.currentTheme" v-model="inbound.stream.tls.alpn">
  44. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
  45. </a-select>
  46. </a-form-item>
  47. <a-form-item label="Allow Insecure">
  48. <a-switch v-model="inbound.stream.tls.settings.allowInsecure"></a-switch>
  49. </a-form-item>
  50. <a-form-item label="Reject Unknown SNI">
  51. <a-switch v-model="inbound.stream.tls.rejectUnknownSni"></a-switch>
  52. </a-form-item>
  53. <a-form-item label="Disable System Root">
  54. <a-switch v-model="inbound.stream.tls.disableSystemRoot"></a-switch>
  55. </a-form-item>
  56. <a-form-item label="Session Resumption">
  57. <a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch>
  58. </a-form-item>
  59. <template v-for="cert,index in inbound.stream.tls.certs">
  60. <a-form-item label='{{ i18n "certificate" }}'>
  61. <a-radio-group v-model="cert.useFile" button-style="solid">
  62. <a-radio-button :value="true">{{ i18n "pages.inbounds.certificatePath" }}</a-radio-button>
  63. <a-radio-button :value="false">{{ i18n "pages.inbounds.certificateContent" }}</a-radio-button>
  64. </a-radio-group>
  65. <a-button icon="plus" v-if="index === 0" type="primary" size="small" @click="inbound.stream.tls.addCert()"
  66. style="margin-left: 10px"></a-button>
  67. <a-button icon="minus" v-if="inbound.stream.tls.certs.length>1" type="primary" size="small"
  68. @click="inbound.stream.tls.removeCert(index)" style="margin-left: 10px"></a-button>
  69. </a-form-item>
  70. <template v-if="cert.useFile">
  71. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  72. <a-input v-model.trim="cert.certFile"></a-input>
  73. </a-form-item>
  74. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  75. <a-input v-model.trim="cert.keyFile"></a-input>
  76. </a-form-item>
  77. <a-form-item label=" ">
  78. <a-button type="primary" icon="import" @click="setDefaultCertData(index)">
  79. {{ i18n "pages.inbounds.setDefaultCert" }}</a-button>
  80. </a-form-item>
  81. </template>
  82. <template v-else>
  83. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  84. <a-input type="textarea" :rows="3" v-model="cert.cert"></a-input>
  85. </a-form-item>
  86. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  87. <a-input type="textarea" :rows="3" v-model="cert.key"></a-input>
  88. </a-form-item>
  89. </template>
  90. <a-form-item label='OCSP stapling'>
  91. <a-input-number v-model.number="cert.ocspStapling" :min="0"></a-input-number>
  92. </a-form-item>
  93. <a-form-item label="One Time Loading">
  94. <a-switch v-model="cert.oneTimeLoading"></a-switch>
  95. </a-form-item>
  96. <a-form-item label='Usage Option'>
  97. <a-select v-model="cert.usage" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  98. <a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key ]]</a-select-option>
  99. </a-select>
  100. </a-form-item>
  101. <a-form-item label="Build Chain" v-if="cert.usage === 'issue'">
  102. <a-switch v-model="cert.buildChain"></a-switch>
  103. </a-form-item>
  104. </template>
  105. </template>
  106. <!-- reality settings -->
  107. <template v-if="inbound.stream.isReality">
  108. {{template "form/realitySettings"}}
  109. </template>
  110. </a-form>
  111. {{end}}