@ -768,7 +768,7 @@ func TestConfigurator_MutualTLSCapable(t *testing.T) {
c , err := NewConfigurator ( config , nil )
c , err := NewConfigurator ( config , nil )
require . NoError ( t , err )
require . NoError ( t , err )
require . False ( t , c . m utualTLSCapable( ) )
require . False ( t , c . M utualTLSCapable( ) )
} )
} )
t . Run ( "ca and no keys" , func ( t * testing . T ) {
t . Run ( "ca and no keys" , func ( t * testing . T ) {
@ -779,7 +779,7 @@ func TestConfigurator_MutualTLSCapable(t *testing.T) {
c , err := NewConfigurator ( config , nil )
c , err := NewConfigurator ( config , nil )
require . NoError ( t , err )
require . NoError ( t , err )
require . False ( t , c . m utualTLSCapable( ) )
require . False ( t , c . M utualTLSCapable( ) )
} )
} )
t . Run ( "ca and manual key" , func ( t * testing . T ) {
t . Run ( "ca and manual key" , func ( t * testing . T ) {
@ -792,7 +792,7 @@ func TestConfigurator_MutualTLSCapable(t *testing.T) {
c , err := NewConfigurator ( config , nil )
c , err := NewConfigurator ( config , nil )
require . NoError ( t , err )
require . NoError ( t , err )
require . True ( t , c . m utualTLSCapable( ) )
require . True ( t , c . M utualTLSCapable( ) )
} )
} )
loadFile := func ( t * testing . T , path string ) string {
loadFile := func ( t * testing . T , path string ) string {
@ -811,7 +811,7 @@ func TestConfigurator_MutualTLSCapable(t *testing.T) {
caPEM := loadFile ( t , "../test/hostname/CertAuth.crt" )
caPEM := loadFile ( t , "../test/hostname/CertAuth.crt" )
require . NoError ( t , c . UpdateAutoTLSCA ( [ ] string { caPEM } ) )
require . NoError ( t , c . UpdateAutoTLSCA ( [ ] string { caPEM } ) )
require . False ( t , c . m utualTLSCapable( ) )
require . False ( t , c . M utualTLSCapable( ) )
} )
} )
t . Run ( "autoencrypt ca and autoencrypt key" , func ( t * testing . T ) {
t . Run ( "autoencrypt ca and autoencrypt key" , func ( t * testing . T ) {
@ -827,7 +827,7 @@ func TestConfigurator_MutualTLSCapable(t *testing.T) {
require . NoError ( t , c . UpdateAutoTLSCA ( [ ] string { caPEM } ) )
require . NoError ( t , c . UpdateAutoTLSCA ( [ ] string { caPEM } ) )
require . NoError ( t , c . UpdateAutoTLSCert ( certPEM , keyPEM ) )
require . NoError ( t , c . UpdateAutoTLSCert ( certPEM , keyPEM ) )
require . True ( t , c . m utualTLSCapable( ) )
require . True ( t , c . M utualTLSCapable( ) )
} )
} )
}
}
@ -858,14 +858,6 @@ func TestConfigurator_VerifyIncomingHTTPS(t *testing.T) {
require . Equal ( t , c . base . VerifyIncomingHTTPS , verify )
require . Equal ( t , c . base . VerifyIncomingHTTPS , verify )
}
}
func TestConfigurator_EnableAgentTLSForChecks ( t * testing . T ) {
c := Configurator { base : & Config {
EnableAgentTLSForChecks : true ,
} }
enabled := c . enableAgentTLSForChecks ( )
require . Equal ( t , c . base . EnableAgentTLSForChecks , enabled )
}
func TestConfigurator_IncomingRPCConfig ( t * testing . T ) {
func TestConfigurator_IncomingRPCConfig ( t * testing . T ) {
c , err := NewConfigurator ( Config {
c , err := NewConfigurator ( Config {
VerifyIncomingRPC : true ,
VerifyIncomingRPC : true ,
@ -1068,7 +1060,7 @@ func TestConfigurator_OutgoingRPCConfig(t *testing.T) {
func TestConfigurator_OutgoingALPNRPCConfig ( t * testing . T ) {
func TestConfigurator_OutgoingALPNRPCConfig ( t * testing . T ) {
c := & Configurator { base : & Config { } }
c := & Configurator { base : & Config { } }
require . Nil ( t , c . O utgoingALPNRPCConfig( ) )
require . Nil ( t , c . o utgoingALPNRPCConfig( ) )
c , err := NewConfigurator ( Config {
c , err := NewConfigurator ( Config {
VerifyOutgoing : false , // ignored, assumed true
VerifyOutgoing : false , // ignored, assumed true
@ -1078,7 +1070,7 @@ func TestConfigurator_OutgoingALPNRPCConfig(t *testing.T) {
} , nil )
} , nil )
require . NoError ( t , err )
require . NoError ( t , err )
tlsConf := c . O utgoingALPNRPCConfig( )
tlsConf := c . o utgoingALPNRPCConfig( )
require . NotNil ( t , tlsConf )
require . NotNil ( t , tlsConf )
require . Equal ( t , tls . RequireAndVerifyClientCert , tlsConf . ClientAuth )
require . Equal ( t , tls . RequireAndVerifyClientCert , tlsConf . ClientAuth )
require . False ( t , tlsConf . InsecureSkipVerify )
require . False ( t , tlsConf . InsecureSkipVerify )