From 37df3bdcfaa7ba050b3059d1d110db9a5c235ecc Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Wed, 22 Jun 2022 08:16:11 -0500 Subject: [PATCH] Fall back to full node keypair if seeder section or keys are missing from the config --- pkg/httpclient/httpclient.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/httpclient/httpclient.go b/pkg/httpclient/httpclient.go index d21b708..7d898a1 100644 --- a/pkg/httpclient/httpclient.go +++ b/pkg/httpclient/httpclient.go @@ -206,7 +206,12 @@ func (c *HTTPClient) initialKeyPairs() error { c.crawlerKeyPair, err = c.config.Seeder.CrawlerConfig.SSL.LoadPrivateKeyPair() if err != nil { - return fmt.Errorf("error loading crawler config: %w", err) + // Fall back to just using the full node certs in this case + // This should only happen on old installations that didn't have the crawler in the config initially + c.crawlerKeyPair, err = c.config.FullNode.SSL.LoadPrivateKeyPair() + if err != nil { + return fmt.Errorf("error loading crawler config: %w", err) + } } return nil