github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/lib/srpc/setupserver/api.go (about) 1 /* 2 Package setupserver assists in setting up TLS credentials for a server. 3 4 Package setupserver provides convenience functions for setting up a server 5 with TLS credentials. 6 */ 7 package setupserver 8 9 // SetupTls loads client and server certificates from files and registers them 10 // with the lib/srpc package. The following command-line flags are registered 11 // with the standard flag package: 12 // -caFile: Name of file containing the root of trust 13 // -certFile: Name of file containing the SSL certificate 14 // -keyFile: Name of file containing the SSL key 15 func SetupTls() error { 16 return setupTls(true) 17 } 18 19 // SetupTlsClientOnly loads a client certificate from files and registers it 20 // with the lib/srpc package. 21 func SetupTlsClientOnly() error { 22 return setupTls(false) 23 }