@@ -574,6 +574,8 @@ func (c *Client) Start() (addr net.Addr, err error) {
574
574
575
575
c .config .TLSConfig = & tls.Config {
576
576
Certificates : []tls.Certificate {cert },
577
+ ClientAuth : tls .RequireAndVerifyClientCert ,
578
+ MinVersion : tls .VersionTLS12 ,
577
579
ServerName : "localhost" ,
578
580
}
579
581
}
@@ -629,17 +631,19 @@ func (c *Client) Start() (addr net.Addr, err error) {
629
631
// Wait for the command to end.
630
632
err := cmd .Wait ()
631
633
632
- debugMsgArgs := []interface {}{
634
+ msgArgs := []interface {}{
633
635
"path" , path ,
634
636
"pid" , pid ,
635
637
}
636
638
if err != nil {
637
- debugMsgArgs = append (debugMsgArgs ,
639
+ msgArgs = append (msgArgs ,
638
640
[]interface {}{"error" , err .Error ()}... )
641
+ c .logger .Error ("plugin process exited" , msgArgs ... )
642
+ } else {
643
+ // Log and make sure to flush the logs right away
644
+ c .logger .Info ("plugin process exited" , msgArgs ... )
639
645
}
640
646
641
- // Log and make sure to flush the logs write away
642
- c .logger .Debug ("plugin process exited" , debugMsgArgs ... )
643
647
os .Stderr .Sync ()
644
648
645
649
// Set that we exited, which takes a lock
@@ -774,7 +778,7 @@ func (c *Client) Start() (addr net.Addr, err error) {
774
778
}
775
779
776
780
// loadServerCert is used by AutoMTLS to read an x.509 cert returned by the
777
- // server, and load it as the RootCA for the client TLSConfig.
781
+ // server, and load it as the RootCA and ClientCA for the client TLSConfig.
778
782
func (c * Client ) loadServerCert (cert string ) error {
779
783
certPool := x509 .NewCertPool ()
780
784
@@ -791,6 +795,7 @@ func (c *Client) loadServerCert(cert string) error {
791
795
certPool .AddCert (x509Cert )
792
796
793
797
c .config .TLSConfig .RootCAs = certPool
798
+ c .config .TLSConfig .ClientCAs = certPool
794
799
return nil
795
800
}
796
801
0 commit comments