Skip to content

Commit e17a782

Browse files
committed
fix
1 parent 315cd58 commit e17a782

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tls/tls.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (cm *CertificateManager) GetCACertPEM() ([]byte, error) {
6666
// Returns the TLS config, CA cert path, and config directory
6767
func (cm *CertificateManager) SetupTLSAndWriteCACert() (*tls.Config, string, string, error) {
6868
// Get config directory
69-
configDir, err := GetConfigDir()
69+
configDir, err := getConfigDir()
7070
if err != nil {
7171
return nil, "", "", fmt.Errorf("failed to get config directory: %v", err)
7272
}
@@ -313,11 +313,11 @@ func (cm *CertificateManager) generateServerCertificate(hostname string) (*tls.C
313313
PostalCode: []string{""},
314314
CommonName: hostname,
315315
},
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},
321321
}
322322

323323
// Add IP address if hostname is an IP
@@ -342,8 +342,8 @@ func (cm *CertificateManager) generateServerCertificate(hostname string) (*tls.C
342342
return tlsCert, nil
343343
}
344344

345-
// GetConfigDir returns the configuration directory path
346-
func GetConfigDir() (string, error) {
345+
// getConfigDir returns the configuration directory path
346+
func getConfigDir() (string, error) {
347347
// When running under sudo, use the original user's home directory
348348
// so the subprocess can access the CA certificate files
349349
var homeDir string
@@ -378,4 +378,4 @@ func GetConfigDir() (string, error) {
378378
}
379379

380380
return configDir, nil
381-
}
381+
}

0 commit comments

Comments
 (0)