github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/lib/srpc/setupclient/api.go (about)

     1  /*
     2  	Package setupclient assists in setting up TLS credentials for a client.
     3  
     4  	Package setupclient provides convenience functions for setting up a client
     5  	(tool) with TLS credentials.
     6  */
     7  package setupclient
     8  
     9  import (
    10  	"flag"
    11  	"os"
    12  	"path"
    13  )
    14  
    15  var (
    16  	certDirectory = flag.String("certDirectory",
    17  		path.Join(os.Getenv("HOME"), ".ssl"),
    18  		"Name of directory containing user SSL certificates")
    19  )
    20  
    21  // GetCertDirectory returns the directory containing the client certificates.
    22  func GetCertDirectory() string {
    23  	return *certDirectory
    24  }
    25  
    26  // SetupTls loads zero or more client certificates from files and registers them
    27  // with the lib/srpc package. The following command-line flags are registered
    28  // with the standard flag package:
    29  //   -certDirectory: Name of directory containing user SSL certificates
    30  func SetupTls(ignoreMissingCerts bool) error {
    31  	return setupTls(ignoreMissingCerts)
    32  }