From 3bc7f2252dda0049bb6fd4a73d9da1b73a2017f3 Mon Sep 17 00:00:00 2001 From: Kaede Akino Date: Wed, 4 Dec 2024 17:33:41 +0800 Subject: [PATCH] feat: copy some certificate related options for uTLS --- transport/internet/tls/utls/utls.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/transport/internet/tls/utls/utls.go b/transport/internet/tls/utls/utls.go index be4b42e0607..da8eed6e544 100644 --- a/transport/internet/tls/utls/utls.go +++ b/transport/internet/tls/utls/utls.go @@ -106,11 +106,15 @@ func (u uTLSClientConnection) GetConnectionApplicationProtocol() (string, error) func uTLSConfigFromTLSConfig(config *systls.Config) (*utls.Config, error) { // nolint: unparam uconfig := &utls.Config{ - Rand: config.Rand, - Time: config.Time, - RootCAs: config.RootCAs, - NextProtos: config.NextProtos, - ServerName: config.ServerName, + Rand: config.Rand, + Time: config.Time, + RootCAs: config.RootCAs, + NextProtos: config.NextProtos, + ServerName: config.ServerName, + VerifyPeerCertificate: config.VerifyPeerCertificate, + InsecureSkipVerify: config.InsecureSkipVerify, + ClientAuth: utls.ClientAuthType(config.ClientAuth), + ClientCAs: config.ClientCAs, } return uconfig, nil }