Skip to content

Commit f360fa7

Browse files
committed
rfq+tapcfg: disable tls when flag present
Ensures the price oracle TLS toggle fits the existing pattern of flags defaulting to false.
1 parent 5623f39 commit f360fa7

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

rfq/cli.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ const (
2222
type CliConfig struct {
2323
PriceOracleAddress string `long:"priceoracleaddress" description:"Price oracle gRPC server address (rfqrpc://<hostname>:<port>). To use the integrated mock, use the following value: use_mock_price_oracle_service_promise_to_not_use_on_mainnet"`
2424

25-
PriceOracleTLS bool `long:"priceoracletls" description:"Enable TLS for communication with a price oracle."`
25+
PriceOracleTLSDisable bool `long:"priceoracletlsdisable" description:"Disable TLS for price oracle communication."`
2626

27-
PriceOracleTLSInsecure bool `long:"priceoracletlsinsecure" description:"Disable verification of price oracle certificates."`
27+
PriceOracleTLSInsecure bool `long:"priceoracletlsinsecure" description:"Disable price oracle certificate verification."`
2828

2929
PriceOracleTLSNoSystemCAs bool `long:"priceoracletlsnosystemcas" description:"Disable use of the operating system's list of root CA's when verifiying price oracle certificates."`
3030

sample-tapd.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@
446446
; use_mock_price_oracle_service_promise_to_not_use_on_mainnet
447447
; experimental.rfq.priceoracleaddress=
448448

449-
; Enable TLS for price oracle communication.
450-
; experimental.rfq.priceoracletls=true
449+
; Disable TLS for price oracle communication.
450+
; experimental.rfq.priceoracletlsdisable=false
451451

452452
; Skip price oracle certificate verification, yielding an insecure (cleartext)
453453
; channel with the price oracle. Should only be used for testing.

tapcfg/config.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ const (
149149
// output amount ratio to use when funding PSBTs.
150150
DefaultPsbtMaxFeeRatio = lndservices.DefaultPsbtMaxFeeRatio
151151

152-
// defaultPriceOracleTLS is the default TLS setting to use when
153-
// communicating with price oracles.
154-
defaultPriceOracleTLS = true
152+
// defaultPriceOracleTLSDisable disables TLS for price oracle
153+
// communication.
154+
defaultPriceOracleTLSDisable = false
155155

156156
// defaultPriceOracleTLSInsecure is the default value we'll use for
157157
// deciding to verify certificates in TLS connections with price
@@ -524,7 +524,7 @@ func DefaultConfig() Config {
524524
Experimental: &ExperimentalConfig{
525525
Rfq: rfq.CliConfig{
526526
AcceptPriceDeviationPpm: rfq.DefaultAcceptPriceDeviationPpm,
527-
PriceOracleTLS: defaultPriceOracleTLS,
527+
PriceOracleTLSDisable: defaultPriceOracleTLSDisable,
528528
PriceOracleTLSInsecure: defaultPriceOracleTLSInsecure,
529529
PriceOracleTLSNoSystemCAs: defaultPriceOracleTLSNoSystemCAs,
530530
PriceOracleTLSCertPath: defaultPriceOracleTLSCertPath,
@@ -1227,7 +1227,9 @@ func getPriceOracleTLSConfig(rfqCfg rfq.CliConfig) (*rfq.TLSConfig, error) {
12271227

12281228
// Construct the oracle's TLS configuration.
12291229
tlsConfig := &rfq.TLSConfig{
1230-
Enabled: rfqCfg.PriceOracleTLS,
1230+
// Note the subtle flip on the flag, since the user has
1231+
// configured whether to *disable* TLS.
1232+
Enabled: !rfqCfg.PriceOracleTLSDisable,
12311233
InsecureSkipVerify: rfqCfg.PriceOracleTLSInsecure,
12321234
// Note the subtle flip on the flag, since the user has
12331235
// configured whether to *not* trust the system CA's.

0 commit comments

Comments
 (0)