@@ -240,7 +240,7 @@ func runMain() error {
240
240
241
241
return nil
242
242
case manualMode && configMode :
243
- return fmt .Errorf ("can't specify both --manual-activation and --config-only! " )
243
+ return fmt .Errorf ("can't specify both --manual-activation and --config-only" )
244
244
case manualMode :
245
245
// Allow manual activation (requires the CSR to be manually signed).
246
246
// manual activation won't proceed to start the server
@@ -403,15 +403,15 @@ func validCertExpiry(cert *x509.Certificate) bool {
403
403
}
404
404
405
405
// needNewCertAndKey checks the validity of certificate and key
406
- func (config Config ) needNewCertAndKey () bool {
407
- _ , err := tls .LoadX509KeyPair (config .CertFile , config .KeyFile )
406
+ func (c Config ) needNewCertAndKey () bool {
407
+ _ , err := tls .LoadX509KeyPair (c .CertFile , c .KeyFile )
408
408
if err != nil {
409
409
log .Errorf ("cannot load server cert/key: %v" , err )
410
410
return true
411
411
}
412
412
413
413
// error is ignore because tls.LoadX509KeyPair already verify the existence of the file
414
- certBytes , _ := os .ReadFile (config .CertFile )
414
+ certBytes , _ := os .ReadFile (c .CertFile )
415
415
// error is ignore because tls.LoadX509KeyPair already verify the file can be parsed
416
416
cert , _ := helpers .ParseCertificatePEM (certBytes )
417
417
// verify the leaf certificate
@@ -424,8 +424,8 @@ func (config Config) needNewCertAndKey() bool {
424
424
}
425
425
426
426
// verifyCSRAndKey checks if csr and key files exist and if they match
427
- func (config Config ) verifyCSRAndKey () bool {
428
- csrBytes , err := os .ReadFile (config .CSRFile )
427
+ func (c Config ) verifyCSRAndKey () bool {
428
+ csrBytes , err := os .ReadFile (c .CSRFile )
429
429
if err != nil {
430
430
log .Errorf ("cannot read csr file: %v" , err )
431
431
return false
@@ -448,7 +448,7 @@ func (config Config) verifyCSRAndKey() bool {
448
448
return false
449
449
}
450
450
451
- keyBytes , err := os .ReadFile (config .KeyFile )
451
+ keyBytes , err := os .ReadFile (c .KeyFile )
452
452
if err != nil {
453
453
log .Errorf ("cannot read private key file: %v" , err )
454
454
return false
0 commit comments