mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 19:39:35 +03:00
Added uTLS to gRPC (#1264)
* Added uTLS to gRPC * Use base 16 of ciphers as StandardName
This commit is contained in:
@ -121,7 +121,13 @@ func getGrpcClient(ctx context.Context, dest net.Destination, streamSettings *in
|
||||
}
|
||||
|
||||
if tlsConfig != nil {
|
||||
dialOptions = append(dialOptions, grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig.GetTLSConfig())))
|
||||
var transportCredential credentials.TransportCredentials
|
||||
if fingerprint, exists := tls.Fingerprints[tlsConfig.Fingerprint]; exists {
|
||||
transportCredential = tls.NewGrpcUtls(tlsConfig.GetTLSConfig(), fingerprint)
|
||||
} else { // Fallback to normal gRPC TLS
|
||||
transportCredential = credentials.NewTLS(tlsConfig.GetTLSConfig())
|
||||
}
|
||||
dialOptions = append(dialOptions, grpc.WithTransportCredentials(transportCredential))
|
||||
} else {
|
||||
dialOptions = append(dialOptions, grpc.WithInsecure())
|
||||
}
|
||||
|
Reference in New Issue
Block a user