Skip to content

Commit c6afd83

Browse files
authored
Deprecate Embedded Certs (prebid#4625)
1 parent 828b830 commit c6afd83

5 files changed

Lines changed: 27 additions & 3691 deletions

File tree

config/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ type Configuration struct {
7979
AccountDefaults Account `mapstructure:"account_defaults"`
8080
// accountDefaultsJSON is the internal serialized form of AccountDefaults used for json merge
8181
accountDefaultsJSON json.RawMessage
82-
// CertsUseSystem will use the host OS certificates instead of embedded certs.
83-
CertsUseSystem bool `mapstructure:"certificates_use_system"`
8482
// Local private file containing SSL certificates
8583
PemCertsFile string `mapstructure:"certificates_file"`
8684
// Custom headers to handle request timeouts from queueing infrastructure
@@ -1253,7 +1251,6 @@ func SetupViper(v *viper.Viper, filename string, bidderInfos BidderInfos) {
12531251
v.SetDefault("compression.response.enable_gzip", false)
12541252
v.SetDefault("compression.request.enable_gzip", false)
12551253

1256-
v.SetDefault("certificates_use_system", false)
12571254
v.SetDefault("certificates_file", "")
12581255

12591256
v.SetDefault("auto_gen_source_tid", true)

config/config_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ analytics:
600600
- code: agma-code
601601
publisher_id: publisher-id
602602
site_app_id: site-or-app-id
603-
certificates_use_system: true
604603
`)
605604

606605
func cmpStrings(t *testing.T, key, expected, actual string) {
@@ -949,7 +948,6 @@ func TestFullConfig(t *testing.T) {
949948
cmpStrings(t, "analytics.agma.accounts.0.publisher_id", "publisher-id", cfg.Analytics.Agma.Accounts[0].PublisherId)
950949
cmpStrings(t, "analytics.agma.accounts.0.code", "agma-code", cfg.Analytics.Agma.Accounts[0].Code)
951950
cmpStrings(t, "analytics.agma.accounts.0.site_app_id", "site-or-app-id", cfg.Analytics.Agma.Accounts[0].SiteAppId)
952-
cmpBools(t, "certificates_use_system", true, cfg.CertsUseSystem)
953951
}
954952

955953
func TestValidateConfig(t *testing.T) {

router/router.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,14 @@ func New(cfg *config.Configuration, rateConvertor *currency.RateConverter) (r *R
128128
Router: httprouter.New(),
129129
}
130130

131-
// For bid processing, we need both the hardcoded certificates and the certificates found in container's
132-
// local file system
133-
certPool, certPoolCreateErr := ssl.CreateCertPool(cfg.CertsUseSystem)
131+
certPool, certPoolCreateErr := ssl.CreateCertPool()
134132
if certPoolCreateErr != nil {
135133
logger.Infof("Could not load root certificates: %s \n", certPoolCreateErr.Error())
136134
}
137135

136+
// load optional PEM certificate files
138137
var readCertErr error
139-
certPool, readCertErr = ssl.AppendPEMFileToRootCAPool(certPool, cfg.PemCertsFile)
138+
certPool, readCertErr = ssl.AppendPEMFileToCertPool(certPool, cfg.PemCertsFile)
140139
if readCertErr != nil {
141140
logger.Infof("Could not read certificates file: %s \n", readCertErr.Error())
142141
}

0 commit comments

Comments
 (0)