Skip to content

Commit 55956f8

Browse files
TLS config: Remove some deprecated fields (#6226)
https://t.me/projectXtls/1490 --------- Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
1 parent 94ffd50 commit 55956f8

4 files changed

Lines changed: 7 additions & 46 deletions

File tree

infra/conf/transport_internet.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"strconv"
1515
"strings"
1616
"syscall"
17-
"time"
1817

1918
"github.com/xtls/xray-core/common"
2019
"github.com/xtls/xray-core/common/errors"
@@ -651,10 +650,8 @@ type TLSConfig struct {
651650
MasterKeyLog string `json:"masterKeyLog"`
652651
PinnedPeerCertSha256 string `json:"pinnedPeerCertSha256"`
653652
VerifyPeerCertByName string `json:"verifyPeerCertByName"`
654-
VerifyPeerCertInNames []string `json:"verifyPeerCertInNames"`
655653
ECHServerKeys string `json:"echServerKeys"`
656654
ECHConfigList string `json:"echConfigList"`
657-
ECHForceQuery string `json:"echForceQuery"`
658655
ECHSocketSettings *SocketConfig `json:"echSockopt"`
659656
}
660657

@@ -699,12 +696,7 @@ func (c *TLSConfig) Build() (proto.Message, error) {
699696
config.MasterKeyLog = c.MasterKeyLog
700697

701698
if c.AllowInsecure {
702-
if time.Now().After(time.Date(2026, 6, 1, 0, 0, 0, 0, time.UTC)) {
703-
return nil, errors.PrintRemovedFeatureError(`"allowInsecure"`, `"pinnedPeerCertSha256"`)
704-
} else {
705-
errors.LogWarning(context.Background(), `"allowInsecure" will be removed automatically after 2026-06-01, please use "pinnedPeerCertSha256"(pcs) and "verifyPeerCertByName"(vcn) instead, PLEASE CONTACT YOUR SERVICE PROVIDER (AIRPORT)`)
706-
config.AllowInsecure = true
707-
}
699+
return nil, errors.PrintRemovedFeatureError(`"allowInsecure"`, `"pinnedPeerCertSha256"(pcs) and "verifyPeerCertByName"(vcn)`)
708700
}
709701
if c.PinnedPeerCertSha256 != "" {
710702
for v := range strings.SplitSeq(c.PinnedPeerCertSha256, ",") {
@@ -723,10 +715,6 @@ func (c *TLSConfig) Build() (proto.Message, error) {
723715
config.PinnedPeerCertSha256 = append(config.PinnedPeerCertSha256, hashValue)
724716
}
725717
}
726-
727-
if c.VerifyPeerCertInNames != nil {
728-
return nil, errors.PrintRemovedFeatureError(`"verifyPeerCertInNames"`, `"verifyPeerCertByName"`)
729-
}
730718
if c.VerifyPeerCertByName != "" {
731719
for v := range strings.SplitSeq(c.VerifyPeerCertByName, ",") {
732720
v = strings.TrimSpace(v)
@@ -744,13 +732,6 @@ func (c *TLSConfig) Build() (proto.Message, error) {
744732
}
745733
config.EchServerKeys = EchPrivateKey
746734
}
747-
switch c.ECHForceQuery {
748-
case "none", "half", "full", "":
749-
config.EchForceQuery = c.ECHForceQuery
750-
default:
751-
return nil, errors.New(`invalid "echForceQuery": `, c.ECHForceQuery)
752-
}
753-
config.EchForceQuery = c.ECHForceQuery
754735
config.EchConfigList = c.ECHConfigList
755736
if c.ECHSocketSettings != nil {
756737
ss, err := c.ECHSocketSettings.Build()

transport/internet/tls/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ func (c *Config) GetTLSConfig(opts ...Option) *tls.Config {
381381
PinnedPeerCertSha256: c.PinnedPeerCertSha256,
382382
}
383383
config := &tls.Config{
384-
InsecureSkipVerify: c.AllowInsecure,
385384
Rand: randCarrier,
386385
ClientSessionCache: globalSessionCache,
387386
RootCAs: root,

transport/internet/tls/config.pb.go

Lines changed: 4 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

transport/internet/tls/config.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ message Certificate {
3838
}
3939

4040
message Config {
41-
bool allow_insecure = 1;
41+
// Number 1 was assigned and used by an legacy option.
4242

4343
// List of certificates to be served on server.
4444
repeated Certificate certificate = 2;
@@ -81,8 +81,7 @@ message Config {
8181

8282
string ech_config_list = 19;
8383

84-
// Deprecated
85-
string ech_force_query = 20;
84+
// Number 20 was assigned and used by an legacy option.
8685

8786
SocketConfig ech_socket_settings = 21;
8887

0 commit comments

Comments
 (0)