tls_settings.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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: '100%' }"
  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. <a-form-item label="VerifyPeerCertInNames">
  60. <a-input v-model.trim="inbound.stream.tls.verifyPeerCertInNames"></a-input>
  61. </a-form-item>
  62. <a-divider :style="{ margin: '3px 0' }"></a-divider>
  63. <template v-for="cert,index in inbound.stream.tls.certs">
  64. <a-form-item label='{{ i18n "certificate" }}'>
  65. <a-radio-group v-model="cert.useFile" button-style="solid" :style="{ display: 'inline-flex', whiteSpace: 'nowrap', maxWidth: '100%' }">
  66. <a-radio-button :value="true" :style="{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }">{{ i18n "pages.inbounds.certificatePath" }}</a-radio-button>
  67. <a-radio-button :value="false" :style="{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }">{{ i18n "pages.inbounds.certificateContent" }}</a-radio-button>
  68. </a-radio-group>
  69. </a-form-item>
  70. <a-form-item label=" ">
  71. <a-space>
  72. <a-button icon="plus" v-if="index === 0" type="primary" size="small" @click="inbound.stream.tls.addCert()"></a-button>
  73. <a-button icon="minus" v-if="inbound.stream.tls.certs.length>1" type="primary" size="small"
  74. @click="inbound.stream.tls.removeCert(index)"></a-button>
  75. </a-space>
  76. </a-form-item>
  77. <template v-if="cert.useFile">
  78. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  79. <a-input v-model.trim="cert.certFile"></a-input>
  80. </a-form-item>
  81. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  82. <a-input v-model.trim="cert.keyFile"></a-input>
  83. </a-form-item>
  84. <a-form-item label=" ">
  85. <a-button type="primary" icon="import" @click="setDefaultCertData(index)">
  86. {{ i18n "pages.inbounds.setDefaultCert" }}</a-button>
  87. </a-form-item>
  88. </template>
  89. <template v-else>
  90. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  91. <a-textarea v-model="cert.cert"></a-textarea>
  92. </a-form-item>
  93. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  94. <a-textarea v-model="cert.key"></a-textarea>
  95. </a-form-item>
  96. </template>
  97. <a-form-item label="One Time Loading">
  98. <a-switch v-model="cert.oneTimeLoading"></a-switch>
  99. </a-form-item>
  100. <a-form-item label='Usage Option'>
  101. <a-select v-model="cert.usage" :style="{ width: '50%' }" :dropdown-class-name="themeSwitcher.currentTheme">
  102. <a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key ]]</a-select-option>
  103. </a-select>
  104. </a-form-item>
  105. <a-form-item label="Build Chain" v-if="cert.usage === 'issue'">
  106. <a-switch v-model="cert.buildChain"></a-switch>
  107. </a-form-item>
  108. </template>
  109. <a-form-item label='ECH key'>
  110. <a-input v-model="inbound.stream.tls.echServerKeys"></a-input>
  111. </a-form-item>
  112. <a-form-item label='ECH config'>
  113. <a-input v-model="inbound.stream.tls.settings.echConfigList"></a-input>
  114. </a-form-item>
  115. <a-form-item label='ECH force query'>
  116. <a-select v-model="inbound.stream.tls.echForceQuery"
  117. :dropdown-class-name="themeSwitcher.currentTheme">
  118. <a-select-option v-for="key in ['none', 'half', 'full']" :value="key">[[ key ]]</a-select-option>
  119. </a-select>
  120. </a-form-item>
  121. <a-form-item label=" ">
  122. <a-space>
  123. <a-button type="primary" icon="import" @click="getNewEchCert">Get New ECH Cert</a-button>
  124. <a-button danger @click="clearEchCert">Clear</a-button>
  125. </a-space>
  126. </a-form-item>
  127. </template>
  128. <!-- reality settings -->
  129. <template v-if="inbound.stream.isReality">
  130. {{template "form/realitySettings"}}
  131. </template>
  132. </a-form>
  133. {{end}}