aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShelikhoo <xiaokangwang@outlook.com>2022-02-11 10:03:45 +0000
committerShelikhoo <xiaokangwang@outlook.com>2022-03-16 09:13:29 +0000
commit1573502e93b7149e8a4784e62bb1adc979312940 (patch)
tree4bc907918094e27435a6be7e22505ce953fe514b
parentccfdcab8feb7857a3089f2a88bc2e1e6c52d5865 (diff)
downloadsnowflake-1573502e93b7149e8a4784e62bb1adc979312940.tar.gz
snowflake-1573502e93b7149e8a4784e62bb1adc979312940.zip
Use uTLS aware broker channel constructor
-rw-r--r--client/lib/rendezvous.go6
-rw-r--r--client/lib/snowflake.go5
2 files changed, 6 insertions, 5 deletions
diff --git a/client/lib/rendezvous.go b/client/lib/rendezvous.go
index 7c27dfc..ee07600 100644
--- a/client/lib/rendezvous.go
+++ b/client/lib/rendezvous.go
@@ -56,13 +56,13 @@ func createBrokerTransport() http.RoundTripper {
}
func NewBrokerChannel(broker, ampCache, front string, keepLocalAddresses bool) (*BrokerChannel, error) {
- return NewBrokerChannelWithUTlsClientID(broker, ampCache, front, keepLocalAddresses, "", false)
+ return NewBrokerChannelWithUTlsSettings(broker, ampCache, front, keepLocalAddresses, "", false)
}
-// NewBrokerChannelWithUTlsClientID construct a new BrokerChannel, where:
+// NewBrokerChannelWithUTlsSettings construct a new BrokerChannel, where:
// |broker| is the full URL of the facilitating program which assigns proxies
// to clients, and |front| is the option fronting domain.
-func NewBrokerChannelWithUTlsClientID(broker, ampCache, front string, keepLocalAddresses bool, utlsClientID string, removeSNI bool) (*BrokerChannel, error) {
+func NewBrokerChannelWithUTlsSettings(broker, ampCache, front string, keepLocalAddresses bool, utlsClientID string, removeSNI bool) (*BrokerChannel, error) {
log.Println("Rendezvous using Broker at:", broker)
if ampCache != "" {
log.Println("Through AMP cache at:", ampCache)
diff --git a/client/lib/snowflake.go b/client/lib/snowflake.go
index 510567e..e309b44 100644
--- a/client/lib/snowflake.go
+++ b/client/lib/snowflake.go
@@ -131,8 +131,9 @@ func NewSnowflakeClient(config ClientConfig) (*Transport, error) {
}
// Rendezvous with broker using the given parameters.
- broker, err := NewBrokerChannel(
- config.BrokerURL, config.AmpCacheURL, config.FrontDomain, config.KeepLocalAddresses)
+ broker, err := NewBrokerChannelWithUTlsSettings(
+ config.BrokerURL, config.AmpCacheURL, config.FrontDomain,
+ config.KeepLocalAddresses, config.UTlsClientID, config.UTlsRemoveSNI)
if err != nil {
return nil, err
}