Skip to content

Commit f03cb78

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 9910220 commit f03cb78

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
@@ -435,8 +435,8 @@
435435
; use_mock_price_oracle_service_promise_to_not_use_on_mainnet
436436
; experimental.rfq.priceoracleaddress=
437437

438-
; Enable TLS for price oracle communication.
439-
; experimental.rfq.priceoracletls=true
438+
; Disable TLS for price oracle communication.
439+
; experimental.rfq.priceoracletlsdisable=false
440440

441441
; Skip price oracle certificate verification, yielding an insecure (cleartext)
442442
; 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
@@ -144,9 +144,9 @@ const (
144144
// mailbox message retrieval client authentication.
145145
defaultMailboxAuthTimeout = 10 * time.Second
146146

147-
// defaultPriceOracleTLS is the default TLS setting to use when
148-
// communicating with price oracles.
149-
defaultPriceOracleTLS = true
147+
// defaultPriceOracleTLSDisable disables TLS for price oracle
148+
// communication.
149+
defaultPriceOracleTLSDisable = false
150150

151151
// defaultPriceOracleTLSInsecure is the default value we'll use for
152152
// deciding to verify certificates in TLS connections with price
@@ -500,7 +500,7 @@ func DefaultConfig() Config {
500500
Experimental: &ExperimentalConfig{
501501
Rfq: rfq.CliConfig{
502502
AcceptPriceDeviationPpm: rfq.DefaultAcceptPriceDeviationPpm,
503-
PriceOracleTLS: defaultPriceOracleTLS,
503+
PriceOracleTLSDisable: defaultPriceOracleTLSDisable,
504504
PriceOracleTLSInsecure: defaultPriceOracleTLSInsecure,
505505
PriceOracleTLSNoSystemCAs: defaultPriceOracleTLSNoSystemCAs,
506506
PriceOracleTLSCertPath: defaultPriceOracleTLSCertPath,
@@ -1193,7 +1193,9 @@ func getPriceOracleTLSConfig(rfqCfg rfq.CliConfig) (*rfq.TLSConfig, error) {
11931193

11941194
// Construct the oracle's TLS configuration.
11951195
tlsConfig := &rfq.TLSConfig{
1196-
Enabled: rfqCfg.PriceOracleTLS,
1196+
// Note the subtle flip on the flag, since the user has
1197+
// configured whether to *disable* TLS.
1198+
Enabled: !rfqCfg.PriceOracleTLSDisable,
11971199
InsecureSkipVerify: rfqCfg.PriceOracleTLSInsecure,
11981200
// Note the subtle flip on the flag, since the user has
11991201
// configured whether to *not* trust the system CA's.

0 commit comments

Comments
 (0)