@@ -66,7 +66,7 @@ func (cm *CertificateManager) GetCACertPEM() ([]byte, error) {
66
66
// Returns the TLS config, CA cert path, and config directory
67
67
func (cm * CertificateManager ) SetupTLSAndWriteCACert () (* tls.Config , string , string , error ) {
68
68
// Get config directory
69
- configDir , err := GetConfigDir ()
69
+ configDir , err := getConfigDir ()
70
70
if err != nil {
71
71
return nil , "" , "" , fmt .Errorf ("failed to get config directory: %v" , err )
72
72
}
@@ -313,11 +313,11 @@ func (cm *CertificateManager) generateServerCertificate(hostname string) (*tls.C
313
313
PostalCode : []string {"" },
314
314
CommonName : hostname ,
315
315
},
316
- NotBefore : time .Now (),
317
- NotAfter : time .Now ().Add (24 * time .Hour ), // 1 day
318
- KeyUsage : x509 .KeyUsageKeyEncipherment | x509 .KeyUsageDigitalSignature ,
319
- ExtKeyUsage : []x509.ExtKeyUsage {x509 .ExtKeyUsageServerAuth },
320
- DNSNames : []string {hostname },
316
+ NotBefore : time .Now (),
317
+ NotAfter : time .Now ().Add (24 * time .Hour ), // 1 day
318
+ KeyUsage : x509 .KeyUsageKeyEncipherment | x509 .KeyUsageDigitalSignature ,
319
+ ExtKeyUsage : []x509.ExtKeyUsage {x509 .ExtKeyUsageServerAuth },
320
+ DNSNames : []string {hostname },
321
321
}
322
322
323
323
// Add IP address if hostname is an IP
@@ -342,8 +342,8 @@ func (cm *CertificateManager) generateServerCertificate(hostname string) (*tls.C
342
342
return tlsCert , nil
343
343
}
344
344
345
- // GetConfigDir returns the configuration directory path
346
- func GetConfigDir () (string , error ) {
345
+ // getConfigDir returns the configuration directory path
346
+ func getConfigDir () (string , error ) {
347
347
// When running under sudo, use the original user's home directory
348
348
// so the subprocess can access the CA certificate files
349
349
var homeDir string
@@ -378,4 +378,4 @@ func GetConfigDir() (string, error) {
378
378
}
379
379
380
380
return configDir , nil
381
- }
381
+ }
0 commit comments