tls_settings.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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-form-item label="verifyPeerCertByName">
  73. <a-input v-model.trim="inbound.stream.tls.verifyPeerCertByName"></a-input>
  74. </a-form-item>
  75. <a-form-item label="pinned Peer Cert Sha256">
  76. <a-select mode="tags" v-model="inbound.stream.tls.pinnedPeerCertSha256"
  77. :dropdown-class-name="themeSwitcher.currentTheme"
  78. placeholder="Enter SHA256 fingerprints (base64)">
  79. </a-select>
  80. </a-form-item>
  81. <a-divider :style="{ margin: '3px 0' }"></a-divider>
  82. <template v-for="cert,index in inbound.stream.tls.certs">
  83. <a-form-item label='{{ i18n "certificate" }}'>
  84. <a-radio-group v-model="cert.useFile" button-style="solid"
  85. :style="{ display: 'inline-flex', whiteSpace: 'nowrap', maxWidth: '100%' }">
  86. <a-radio-button :value="true"
  87. :style="{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }">{{
  88. i18n "pages.inbounds.certificatePath" }}</a-radio-button>
  89. <a-radio-button :value="false"
  90. :style="{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }">{{
  91. i18n "pages.inbounds.certificateContent" }}</a-radio-button>
  92. </a-radio-group>
  93. </a-form-item>
  94. <a-form-item label=" ">
  95. <a-space>
  96. <a-button icon="plus" v-if="index === 0" type="primary" size="small"
  97. @click="inbound.stream.tls.addCert()"></a-button>
  98. <a-button icon="minus" v-if="inbound.stream.tls.certs.length>1"
  99. type="primary" size="small"
  100. @click="inbound.stream.tls.removeCert(index)"></a-button>
  101. </a-space>
  102. </a-form-item>
  103. <template v-if="cert.useFile">
  104. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  105. <a-input v-model.trim="cert.certFile"></a-input>
  106. </a-form-item>
  107. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  108. <a-input v-model.trim="cert.keyFile"></a-input>
  109. </a-form-item>
  110. <a-form-item label=" ">
  111. <a-button type="primary" icon="import"
  112. @click="setDefaultCertData(index)">
  113. {{ i18n "pages.inbounds.setDefaultCert" }}</a-button>
  114. </a-form-item>
  115. </template>
  116. <template v-else>
  117. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  118. <a-textarea v-model="cert.cert"></a-textarea>
  119. </a-form-item>
  120. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  121. <a-textarea v-model="cert.key"></a-textarea>
  122. </a-form-item>
  123. </template>
  124. <a-form-item label="One Time Loading">
  125. <a-switch v-model="cert.oneTimeLoading"></a-switch>
  126. </a-form-item>
  127. <a-form-item label='Usage Option'>
  128. <a-select v-model="cert.usage" :style="{ width: '50%' }"
  129. :dropdown-class-name="themeSwitcher.currentTheme">
  130. <a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key
  131. ]]</a-select-option>
  132. </a-select>
  133. </a-form-item>
  134. <a-form-item label="Build Chain" v-if="cert.usage === 'issue'">
  135. <a-switch v-model="cert.buildChain"></a-switch>
  136. </a-form-item>
  137. </template>
  138. <a-form-item label='ECH key'>
  139. <a-input v-model="inbound.stream.tls.echServerKeys"></a-input>
  140. </a-form-item>
  141. <a-form-item label='ECH config'>
  142. <a-input v-model="inbound.stream.tls.settings.echConfigList"></a-input>
  143. </a-form-item>
  144. <a-form-item label='ECH force query'>
  145. <a-select v-model="inbound.stream.tls.echForceQuery"
  146. :dropdown-class-name="themeSwitcher.currentTheme">
  147. <a-select-option v-for="key in ['none', 'half', 'full']" :value="key">[[
  148. key ]]</a-select-option>
  149. </a-select>
  150. </a-form-item>
  151. <a-form-item label=" ">
  152. <a-space>
  153. <a-button type="primary" icon="import" @click="getNewEchCert">Get New
  154. ECH Cert</a-button>
  155. <a-button danger @click="clearEchCert">Clear</a-button>
  156. </a-space>
  157. </a-form-item>
  158. </template>
  159. <!-- reality settings -->
  160. <template v-if="inbound.stream.isReality">
  161. {{template "form/realitySettings"}}
  162. </template>
  163. </a-form>
  164. {{end}}