mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-05-05 17:30:21 +02:00
cert: removed unused args from cert.GenCertPair
Since the cert pair is written with a subsequent call to cert.WriteCertPair we can safely remove the two file paths from the argument list of cert.GenCertPair.
This commit is contained in:
parent
0cf0a7dd3b
commit
c3445e79d9
@ -200,9 +200,9 @@ func IsOutdated(cert *x509.Certificate, tlsExtraIPs,
|
|||||||
//
|
//
|
||||||
// This function is adapted from https://github.com/btcsuite/btcd and
|
// This function is adapted from https://github.com/btcsuite/btcd and
|
||||||
// https://github.com/btcsuite/btcd/btcutil
|
// https://github.com/btcsuite/btcd/btcutil
|
||||||
func GenCertPair(org, certFile, keyFile string, tlsExtraIPs,
|
func GenCertPair(org string, tlsExtraIPs, tlsExtraDomains []string,
|
||||||
tlsExtraDomains []string, tlsDisableAutofill bool,
|
tlsDisableAutofill bool, certValidity time.Duration) (
|
||||||
certValidity time.Duration) ([]byte, []byte, error) {
|
[]byte, []byte, error) {
|
||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
validUntil := now.Add(certValidity)
|
validUntil := now.Add(certValidity)
|
||||||
|
@ -29,8 +29,8 @@ func TestIsOutdatedCert(t *testing.T) {
|
|||||||
|
|
||||||
// Generate TLS files with two extra IPs and domains.
|
// Generate TLS files with two extra IPs and domains.
|
||||||
certBytes, keyBytes, err := cert.GenCertPair(
|
certBytes, keyBytes, err := cert.GenCertPair(
|
||||||
"lnd autogenerated cert", certPath, keyPath, extraIPs[:2],
|
"lnd autogenerated cert", extraIPs[:2], extraDomains[:2],
|
||||||
extraDomains[:2], false, testTLSCertDuration,
|
false, testTLSCertDuration,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@ -89,8 +89,8 @@ func TestIsOutdatedPermutation(t *testing.T) {
|
|||||||
|
|
||||||
// Generate TLS files from the IPs and domains.
|
// Generate TLS files from the IPs and domains.
|
||||||
certBytes, keyBytes, err := cert.GenCertPair(
|
certBytes, keyBytes, err := cert.GenCertPair(
|
||||||
"lnd autogenerated cert", certPath, keyPath, extraIPs[:],
|
"lnd autogenerated cert", extraIPs[:], extraDomains[:],
|
||||||
extraDomains[:], false, testTLSCertDuration,
|
false, testTLSCertDuration,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@ -160,8 +160,8 @@ func TestTLSDisableAutofill(t *testing.T) {
|
|||||||
|
|
||||||
// Generate TLS files with two extra IPs and domains and no interface IPs.
|
// Generate TLS files with two extra IPs and domains and no interface IPs.
|
||||||
certBytes, keyBytes, err := cert.GenCertPair(
|
certBytes, keyBytes, err := cert.GenCertPair(
|
||||||
"lnd autogenerated cert", certPath, keyPath, extraIPs[:2],
|
"lnd autogenerated cert", extraIPs[:2], extraDomains[:2],
|
||||||
extraDomains[:2], true, testTLSCertDuration,
|
true, testTLSCertDuration,
|
||||||
)
|
)
|
||||||
require.NoError(
|
require.NoError(
|
||||||
t, err,
|
t, err,
|
||||||
@ -222,9 +222,8 @@ func TestTLSConfig(t *testing.T) {
|
|||||||
|
|
||||||
// Generate TLS files with an extra IP and domain.
|
// Generate TLS files with an extra IP and domain.
|
||||||
certBytes, keyBytes, err := cert.GenCertPair(
|
certBytes, keyBytes, err := cert.GenCertPair(
|
||||||
"lnd autogenerated cert", certPath, keyPath,
|
"lnd autogenerated cert", []string{extraIPs[0]},
|
||||||
[]string{extraIPs[0]}, []string{extraDomains[0]}, false,
|
[]string{extraDomains[0]}, false, testTLSCertDuration,
|
||||||
testTLSCertDuration,
|
|
||||||
)
|
)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
@ -258,6 +258,9 @@ in the lnwire package](https://github.com/lightningnetwork/lnd/pull/7303)
|
|||||||
* [Add a flag](https://github.com/lightningnetwork/lnd/pull/6527) to allow for
|
* [Add a flag](https://github.com/lightningnetwork/lnd/pull/6527) to allow for
|
||||||
the option to encrypt the tls key.
|
the option to encrypt the tls key.
|
||||||
|
|
||||||
|
* [Remove unused args](https://github.com/lightningnetwork/lnd/pull/7387)
|
||||||
|
from `cert.GenCertPair`.
|
||||||
|
|
||||||
## `lncli`
|
## `lncli`
|
||||||
|
|
||||||
* [Add an `insecure` flag to skip tls auth as well as a `metadata` string slice
|
* [Add an `insecure` flag to skip tls auth as well as a `metadata` string slice
|
||||||
|
Loading…
x
Reference in New Issue
Block a user