mirror of
https://github.com/alibaba/higress.git
synced 2026-06-26 02:35:02 +08:00
Revert "fix: Skip TLS certificate verification for HTTPS upstreams" (#4016)
Signed-off-by: EndlessSeeker <1766508902@qq.com>
This commit is contained in:
@@ -170,9 +170,6 @@ func processMTLS(config *Ingress) *networking.ClientTLSSettings {
|
|||||||
func processSimple(config *Ingress) *networking.ClientTLSSettings {
|
func processSimple(config *Ingress) *networking.ClientTLSSettings {
|
||||||
tls := &networking.ClientTLSSettings{
|
tls := &networking.ClientTLSSettings{
|
||||||
Mode: networking.ClientTLSSettings_SIMPLE,
|
Mode: networking.ClientTLSSettings_SIMPLE,
|
||||||
InsecureSkipVerify: &wrappers.BoolValue{
|
|
||||||
Value: true,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.UpstreamTLS.EnableSNI && config.UpstreamTLS.SNI != "" {
|
if config.UpstreamTLS.EnableSNI && config.UpstreamTLS.SNI != "" {
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ package annotations
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/golang/protobuf/ptypes/wrappers"
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/google/go-cmp/cmp/cmpopts"
|
"github.com/google/go-cmp/cmp/cmpopts"
|
||||||
"google.golang.org/protobuf/testing/protocmp"
|
|
||||||
networking "istio.io/api/networking/v1alpha3"
|
networking "istio.io/api/networking/v1alpha3"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -131,9 +129,6 @@ func TestApplyTrafficPolicy(t *testing.T) {
|
|||||||
Tls: &networking.ClientTLSSettings{
|
Tls: &networking.ClientTLSSettings{
|
||||||
Mode: networking.ClientTLSSettings_SIMPLE,
|
Mode: networking.ClientTLSSettings_SIMPLE,
|
||||||
Sni: "SNI",
|
Sni: "SNI",
|
||||||
InsecureSkipVerify: &wrappers.BoolValue{
|
|
||||||
Value: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -163,9 +158,7 @@ func TestApplyTrafficPolicy(t *testing.T) {
|
|||||||
for _, testCase := range testCases {
|
for _, testCase := range testCases {
|
||||||
t.Run("", func(t *testing.T) {
|
t.Run("", func(t *testing.T) {
|
||||||
parser.ApplyTrafficPolicy(nil, testCase.input, testCase.config)
|
parser.ApplyTrafficPolicy(nil, testCase.input, testCase.config)
|
||||||
if diff := cmp.Diff(testCase.expect, testCase.input, protocmp.Transform(),
|
if diff := cmp.Diff(testCase.expect, testCase.input, cmpopts.IgnoreUnexported(unexportedIgnoredTypes...)); diff != "" {
|
||||||
cmpopts.IgnoreUnexported(unexportedIgnoredTypes...),
|
|
||||||
); diff != "" {
|
|
||||||
t.Fatalf("TestApplyTrafficPolicy() mismatch (-want +got): \n%s", diff)
|
t.Fatalf("TestApplyTrafficPolicy() mismatch (-want +got): \n%s", diff)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user