tls_settings.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. {{define "form/tlsSettings"}}
  2. <!-- tls enable -->
  3. <a-form v-if="inbound.canEnableTls()" :colon="false"
  4. :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
  5. <a-divider :style="{ margin: '3px 0' }"></a-divider>
  6. <a-form-item label='{{ i18n "security" }}'>
  7. <a-radio-group v-model="inbound.stream.security" button-style="solid">
  8. <a-radio-button value="none">{{ i18n "none" }}</a-radio-button>
  9. <a-radio-button v-if="inbound.canEnableReality()"
  10. value="reality">Reality</a-radio-button>
  11. <a-radio-button value="tls">TLS</a-radio-button>
  12. </a-radio-group>
  13. </a-form-item>
  14. <!-- tls settings -->
  15. <template v-if="inbound.stream.isTls">
  16. <a-form-item label="SNI" placeholder="Server Name Indication">
  17. <a-input v-model.trim="inbound.stream.tls.sni"></a-input>
  18. </a-form-item>
  19. <a-form-item label="Cipher Suites">
  20. <a-select v-model="inbound.stream.tls.cipherSuites"
  21. :dropdown-class-name="themeSwitcher.currentTheme">
  22. <a-select-option value>Auto</a-select-option>
  23. <a-select-option v-for="key,value in TLS_CIPHER_OPTION" :value="key">[[
  24. value ]]</a-select-option>
  25. </a-select>
  26. </a-form-item>
  27. <a-form-item label="Min/Max Version">
  28. <a-input-group compact>
  29. <a-select v-model="inbound.stream.tls.minVersion"
  30. :style="{ width: '50%' }"
  31. :dropdown-class-name="themeSwitcher.currentTheme">
  32. <a-select-option v-for="key in TLS_VERSION_OPTION" :value="key">[[ key
  33. ]]</a-select-option>
  34. </a-select>
  35. <a-select v-model="inbound.stream.tls.maxVersion"
  36. :style="{ width: '50%' }"
  37. :dropdown-class-name="themeSwitcher.currentTheme">
  38. <a-select-option v-for="key in TLS_VERSION_OPTION" :value="key">[[ key
  39. ]]</a-select-option>
  40. </a-select>
  41. </a-input-group>
  42. </a-form-item>
  43. <a-form-item label="uTLS">
  44. <a-select v-model="inbound.stream.tls.settings.fingerprint"
  45. :style="{ width: '100%' }"
  46. :dropdown-class-name="themeSwitcher.currentTheme">
  47. <a-select-option value>None</a-select-option>
  48. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key
  49. ]]</a-select-option>
  50. </a-select>
  51. </a-form-item>
  52. <a-form-item label="ALPN">
  53. <a-select mode="multiple"
  54. :dropdown-class-name="themeSwitcher.currentTheme"
  55. v-model="inbound.stream.tls.alpn">
  56. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn
  57. ]]</a-select-option>
  58. </a-select>
  59. </a-form-item>
  60. <a-form-item label="Allow Insecure">
  61. <a-switch v-model="inbound.stream.tls.settings.allowInsecure"></a-switch>
  62. </a-form-item>
  63. <a-form-item label="Reject Unknown SNI">
  64. <a-switch v-model="inbound.stream.tls.rejectUnknownSni"></a-switch>
  65. </a-form-item>
  66. <a-form-item label="Disable System Root">
  67. <a-switch v-model="inbound.stream.tls.disableSystemRoot"></a-switch>
  68. </a-form-item>
  69. <a-form-item label="Session Resumption">
  70. <a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch>
  71. </a-form-item>
  72. <a-divider :style="{ margin: '3px 0' }"></a-divider>
  73. <template v-for="cert,index in inbound.stream.tls.certs">
  74. <a-form-item label='{{ i18n "certificate" }}'>
  75. <a-radio-group v-model="cert.useFile" button-style="solid"
  76. :style="{ display: 'inline-flex', whiteSpace: 'nowrap', maxWidth: '100%' }">
  77. <a-radio-button :value="true"
  78. :style="{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }">{{
  79. i18n "pages.inbounds.certificatePath" }}</a-radio-button>
  80. <a-radio-button :value="false"
  81. :style="{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }">{{
  82. i18n "pages.inbounds.certificateContent" }}</a-radio-button>
  83. </a-radio-group>
  84. </a-form-item>
  85. <a-form-item label=" ">
  86. <a-space>
  87. <a-button icon="plus" v-if="index === 0" type="primary" size="small"
  88. @click="inbound.stream.tls.addCert()"></a-button>
  89. <a-button icon="minus" v-if="inbound.stream.tls.certs.length>1"
  90. type="primary" size="small"
  91. @click="inbound.stream.tls.removeCert(index)"></a-button>
  92. </a-space>
  93. </a-form-item>
  94. <template v-if="cert.useFile">
  95. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  96. <a-input v-model.trim="cert.certFile"></a-input>
  97. </a-form-item>
  98. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  99. <a-input v-model.trim="cert.keyFile"></a-input>
  100. </a-form-item>
  101. <a-form-item label=" ">
  102. <a-button type="primary" icon="import"
  103. @click="setDefaultCertData(index)">
  104. {{ i18n "pages.inbounds.setDefaultCert" }}</a-button>
  105. </a-form-item>
  106. </template>
  107. <template v-else>
  108. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  109. <a-textarea v-model="cert.cert"></a-textarea>
  110. </a-form-item>
  111. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  112. <a-textarea v-model="cert.key"></a-textarea>
  113. </a-form-item>
  114. </template>
  115. <a-form-item label="One Time Loading">
  116. <a-switch v-model="cert.oneTimeLoading"></a-switch>
  117. </a-form-item>
  118. <a-form-item label='Usage Option'>
  119. <a-select v-model="cert.usage" :style="{ width: '50%' }"
  120. :dropdown-class-name="themeSwitcher.currentTheme">
  121. <a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key
  122. ]]</a-select-option>
  123. </a-select>
  124. </a-form-item>
  125. <a-form-item label="Build Chain" v-if="cert.usage === 'issue'">
  126. <a-switch v-model="cert.buildChain"></a-switch>
  127. </a-form-item>
  128. </template>
  129. <a-form-item label='ECH key'>
  130. <a-input v-model="inbound.stream.tls.echServerKeys"></a-input>
  131. </a-form-item>
  132. <a-form-item label='ECH config'>
  133. <a-input v-model="inbound.stream.tls.settings.echConfigList"></a-input>
  134. </a-form-item>
  135. <a-form-item label='ECH force query'>
  136. <a-select v-model="inbound.stream.tls.echForceQuery"
  137. :dropdown-class-name="themeSwitcher.currentTheme">
  138. <a-select-option v-for="key in ['none', 'half', 'full']" :value="key">[[
  139. key ]]</a-select-option>
  140. </a-select>
  141. </a-form-item>
  142. <a-form-item label=" ">
  143. <a-space>
  144. <a-button type="primary" icon="import" @click="getNewEchCert">Get New
  145. ECH Cert</a-button>
  146. <a-button danger @click="clearEchCert">Clear</a-button>
  147. </a-space>
  148. </a-form-item>
  149. </template>
  150. <!-- reality settings -->
  151. <template v-if="inbound.stream.isReality">
  152. {{template "form/realitySettings"}}
  153. </template>
  154. </a-form>
  155. {{end}}