Other: Disable TLS pin checks on QA builds

This commit is contained in:
James Houlahan
2022-10-30 20:22:51 +01:00
parent 5bb2eeafb7
commit 358a2e5266
4 changed files with 83 additions and 31 deletions

View File

@ -56,6 +56,13 @@ func withBridge( //nolint:funlen
cookieJar http.CookieJar,
fn func(*bridge.Bridge, <-chan events.Event) error,
) error {
// Delete old go-imap cache files
if deleteOldGoIMAPFiles {
if err := locations.CleanGoIMAPCache(); err != nil {
logrus.WithError(err).Error("Failed to remove old go-imap cache")
}
}
// Create the underlying dialer used by the bridge.
// It only connects to trusted servers and reports any untrusted servers it finds.
pinningDialer := dialer.NewPinningTLSDialer(
@ -64,13 +71,6 @@ func withBridge( //nolint:funlen
dialer.NewTLSPinChecker(dialer.TrustedAPIPins),
)
// Delete old go-imap cache files
if deleteOldGoIMAPFiles {
if err := locations.CleanGoIMAPCache(); err != nil {
logrus.WithError(err).Error("Failed to remove old go-imap cache")
}
}
// Create a proxy dialer which switches to a proxy if the request fails.
proxyDialer := dialer.NewProxyTLSDialer(pinningDialer, constants.APIHost)