Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion traffic_ops/traffic_ops_golang/cachesstats/cachesstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package cachesstats
*/

import (
"crypto/tls"
"database/sql"
"encoding/json"
"errors"
Expand Down Expand Up @@ -66,7 +67,14 @@ func getCachesStats(tx *sql.Tx) ([]CacheData, error) {
if err != nil {
return nil, errors.New("monitor forward proxy '" + monitorForwardProxy + "' in parameter '" + MonitorProxyParameter + "' not a URI: " + err.Error())
}
client = &http.Client{Timeout: MonitorRequestTimeout, Transport: &http.Transport{Proxy: http.ProxyURL(proxyURI)}}
clientTransport := &http.Transport{Proxy: http.ProxyURL(proxyURI)}
if proxyURI.Scheme == "https" {
// TM does not support HTTP/2 and golang when connecting to https will use HTTP/2 by default causing a conflict
// The result will be an unsupported scheme error
// Setting TLSNextProto to any empty map will disable using HTTP/2 per https://golang.org/src/net/http/doc.go
clientTransport.TLSNextProto = make(map[string]func(authority string, c *tls.Conn) http.RoundTripper)
}
client = &http.Client{Timeout: MonitorRequestTimeout, Transport: clientTransport}
}

cacheData, err := getCacheData(tx)
Expand Down
10 changes: 9 additions & 1 deletion traffic_ops/traffic_ops_golang/cdn/capacity.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package cdn
*/

import (
"crypto/tls"
"database/sql"
"encoding/json"
"errors"
Expand Down Expand Up @@ -105,7 +106,14 @@ func getMonitorsCapacity(tx *sql.Tx, monitors map[tc.CDNName][]string) (Capacity
if err != nil {
return CapacityResp{}, errors.New("monitor forward proxy '" + monitorForwardProxy + "' in parameter '" + MonitorProxyParameter + "' not a URI: " + err.Error())
}
client = &http.Client{Timeout: MonitorRequestTimeout, Transport: &http.Transport{Proxy: http.ProxyURL(proxyURI)}}
clientTransport := &http.Transport{Proxy: http.ProxyURL(proxyURI)}
if proxyURI.Scheme == "https" {
// TM does not support HTTP/2 and golang when connecting to https will use HTTP/2 by default causing a conflict
// The result will be an unsupported scheme error
// Setting TLSNextProto to any empty map will disable using HTTP/2 per https://golang.org/src/net/http/doc.go
clientTransport.TLSNextProto = make(map[string]func(authority string, c *tls.Conn) http.RoundTripper)
}
client = &http.Client{Timeout: MonitorRequestTimeout, Transport: clientTransport}
}

thresholds, err := getEdgeProfileHealthThresholdBandwidth(tx)
Expand Down