|
|
@@ -396,15 +396,22 @@ func CustomTLSDial(
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- var clientSessionCache tris.ClientSessionCache
|
|
|
- if config.ObfuscatedSessionTicketKey != "" {
|
|
|
- clientSessionCache = tris.NewObfuscatedClientSessionCache(
|
|
|
- obfuscatedSessionTicketKey)
|
|
|
- } else {
|
|
|
- clientSessionCache = config.trisClientSessionCache
|
|
|
- if clientSessionCache == nil {
|
|
|
- clientSessionCache = tris.NewLRUClientSessionCache(0)
|
|
|
- }
|
|
|
+ clientSessionCache := config.trisClientSessionCache
|
|
|
+ if clientSessionCache == nil {
|
|
|
+ clientSessionCache = tris.NewLRUClientSessionCache(0)
|
|
|
+ }
|
|
|
+
|
|
|
+ // The tris TLS provider should be used only for TLS 1.3.
|
|
|
+ //
|
|
|
+ // Obfuscated session tickets are not currently supported in TLS 1.3,
|
|
|
+ // but we allow UNFRONTED-MEEK-SESSION-TICKET-OSSH to use TLS 1.3
|
|
|
+ // profiles for additional diversity/capacity; TLS 1.3 encrypts the
|
|
|
+ // server certificate, so the desired obfuscated session tickets
|
|
|
+ // property of obfuscating server certificates is satisfied.
|
|
|
+ //
|
|
|
+ // An additional sanity check:
|
|
|
+ if !protocol.TLSProfileIsTLS13(selectedTLSProfile) {
|
|
|
+ return nil, common.ContextError(errors.New("TLS profile is not TLS 1.3"))
|
|
|
}
|
|
|
|
|
|
tlsConfig := &tris.Config{
|