@@ -489,8 +489,10 @@ func TestNewGRPCServer(t *testing.T) {
489
489
assert .Equal (t , srv .Address (), addr .String ())
490
490
assert .Equal (t , srv .Listener ().Addr ().String (), addr .String ())
491
491
492
- //TlSEnabled should be false
492
+ //TLSEnabled should be false
493
493
assert .Equal (t , srv .TLSEnabled (), false )
494
+ //MutualTLSRequired should be false
495
+ assert .Equal (t , srv .MutualTLSRequired (), false )
494
496
495
497
//register the GRPC test server
496
498
testpb .RegisterTestServiceServer (srv .Server (), & testServiceServer {})
@@ -542,8 +544,10 @@ func TestNewGRPCServerFromListener(t *testing.T) {
542
544
assert .Equal (t , srv .Address (), addr .String ())
543
545
assert .Equal (t , srv .Listener ().Addr ().String (), addr .String ())
544
546
545
- //TlSEnabled should be false
547
+ //TLSEnabled should be false
546
548
assert .Equal (t , srv .TLSEnabled (), false )
549
+ //MutualTLSRequired should be false
550
+ assert .Equal (t , srv .MutualTLSRequired (), false )
547
551
548
552
//register the GRPC test server
549
553
testpb .RegisterTestServiceServer (srv .Server (), & testServiceServer {})
@@ -594,8 +598,10 @@ func TestNewSecureGRPCServer(t *testing.T) {
594
598
cert , _ := tls .X509KeyPair ([]byte (selfSignedCertPEM ), []byte (selfSignedKeyPEM ))
595
599
assert .Equal (t , srv .ServerCertificate (), cert )
596
600
597
- //TlSEnabled should be true
601
+ //TLSEnabled should be true
598
602
assert .Equal (t , srv .TLSEnabled (), true )
603
+ //MutualTLSRequired should be false
604
+ assert .Equal (t , srv .MutualTLSRequired (), false )
599
605
600
606
//register the GRPC test server
601
607
testpb .RegisterTestServiceServer (srv .Server (), & testServiceServer {})
@@ -677,8 +683,10 @@ func TestNewSecureGRPCServerFromListener(t *testing.T) {
677
683
cert , _ := tls .X509KeyPair ([]byte (selfSignedCertPEM ), []byte (selfSignedKeyPEM ))
678
684
assert .Equal (t , srv .ServerCertificate (), cert )
679
685
680
- //TlSEnabled should be true
686
+ //TLSEnabled should be true
681
687
assert .Equal (t , srv .TLSEnabled (), true )
688
+ //MutualTLSRequired should be false
689
+ assert .Equal (t , srv .MutualTLSRequired (), false )
682
690
683
691
//register the GRPC test server
684
692
testpb .RegisterTestServiceServer (srv .Server (), & testServiceServer {})
@@ -894,6 +902,9 @@ func runMutualAuth(t *testing.T, servers []testServer, trustedClients, unTrusted
894
902
return err
895
903
}
896
904
905
+ //MutualTLSRequired should be true
906
+ assert .Equal (t , srv .MutualTLSRequired (), true )
907
+
897
908
//register the GRPC test server and start the GRPCServer
898
909
testpb .RegisterTestServiceServer (srv .Server (), & testServiceServer {})
899
910
go srv .Start ()
0 commit comments