Skip to content

Commit

Permalink
Disable session resumption by default
Browse files Browse the repository at this point in the history
  • Loading branch information
rampagekiller0725 committed Jan 1, 2021
1 parent eeb710e commit c75633d
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 74 deletions.
8 changes: 4 additions & 4 deletions infra/conf/transport_internet.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ type TLSConfig struct {
Certs []*TLSCertConfig `json:"certificates"`
ServerName string `json:"serverName"`
ALPN *StringList `json:"alpn"`
DisableSessionResumption bool `json:"disableSessionResumption"`
EnableSessionResumption bool `json:"enableSessionResumption"`
DisableSystemRoot bool `json:"disableSystemRoot"`
MinVersion string `json:"minVersion"`
MaxVersion string `json:"maxVersion"`
Expand All @@ -321,7 +321,7 @@ func (c *TLSConfig) Build() (proto.Message, error) {
if c.ALPN != nil && len(*c.ALPN) > 0 {
config.NextProtocol = []string(*c.ALPN)
}
config.DisableSessionResumption = c.DisableSessionResumption
config.EnableSessionResumption = c.EnableSessionResumption
config.DisableSystemRoot = c.DisableSystemRoot
config.MinVersion = c.MinVersion
config.MaxVersion = c.MaxVersion
Expand Down Expand Up @@ -378,7 +378,7 @@ type XTLSConfig struct {
Certs []*XTLSCertConfig `json:"certificates"`
ServerName string `json:"serverName"`
ALPN *StringList `json:"alpn"`
DisableSessionResumption bool `json:"disableSessionResumption"`
EnableSessionResumption bool `json:"enableSessionResumption"`
DisableSystemRoot bool `json:"disableSystemRoot"`
MinVersion string `json:"minVersion"`
MaxVersion string `json:"maxVersion"`
Expand All @@ -405,7 +405,7 @@ func (c *XTLSConfig) Build() (proto.Message, error) {
if c.ALPN != nil && len(*c.ALPN) > 0 {
config.NextProtocol = []string(*c.ALPN)
}
config.DisableSessionResumption = c.DisableSessionResumption
config.EnableSessionResumption = c.EnableSessionResumption
config.DisableSystemRoot = c.DisableSystemRoot
config.MinVersion = c.MinVersion
config.MaxVersion = c.MaxVersion
Expand Down
4 changes: 2 additions & 2 deletions transport/internet/tls/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (c *Config) GetTLSConfig(opts ...Option) *tls.Config {
RootCAs: root,
InsecureSkipVerify: false,
NextProtos: nil,
SessionTicketsDisabled: false,
SessionTicketsDisabled: true,
}
}

Expand All @@ -203,7 +203,7 @@ func (c *Config) GetTLSConfig(opts ...Option) *tls.Config {
RootCAs: root,
InsecureSkipVerify: c.AllowInsecure,
NextProtos: c.NextProtocol,
SessionTicketsDisabled: c.DisableSessionResumption,
SessionTicketsDisabled: !c.EnableSessionResumption,
}

for _, opt := range opts {
Expand Down
62 changes: 31 additions & 31 deletions transport/internet/tls/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions transport/internet/tls/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ message Config {
// Lists of string as ALPN values.
repeated string next_protocol = 4;

// Whether or not to disable session (ticket) resumption.
bool disable_session_resumption = 5;
// Whether or not to enable session (ticket) resumption.
bool enable_session_resumption = 5;

// If true, root certificates on the system will not be loaded for
// verification.
Expand Down
4 changes: 2 additions & 2 deletions transport/internet/xtls/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (c *Config) GetXTLSConfig(opts ...Option) *xtls.Config {
RootCAs: root,
InsecureSkipVerify: false,
NextProtos: nil,
SessionTicketsDisabled: false,
SessionTicketsDisabled: true,
}
}

Expand All @@ -194,7 +194,7 @@ func (c *Config) GetXTLSConfig(opts ...Option) *xtls.Config {
RootCAs: root,
InsecureSkipVerify: c.AllowInsecure,
NextProtos: c.NextProtocol,
SessionTicketsDisabled: c.DisableSessionResumption,
SessionTicketsDisabled: !c.EnableSessionResumption,
}

for _, opt := range opts {
Expand Down
62 changes: 31 additions & 31 deletions transport/internet/xtls/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions transport/internet/xtls/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ message Config {
// Lists of string as ALPN values.
repeated string next_protocol = 4;

// Whether or not to disable session (ticket) resumption.
bool disable_session_resumption = 5;
// Whether or not to enable session (ticket) resumption.
bool enable_session_resumption = 5;

// If true, root certificates on the system will not be loaded for
// verification.
Expand Down

0 comments on commit c75633d

Please sign in to comment.