Skip to content

Commit

Permalink
SNOW-1540431 Init ocsp local cache even if cache server is disabled (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pfus authored Jul 17, 2024
1 parent f6155d8 commit cecf890
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ocsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,13 +842,13 @@ func overrideCacheDir() {

// initOCSPCache initializes OCSP Response cache file.
func initOCSPCache() {
ocspResponseCacheLock = &sync.RWMutex{}
ocspParsedRespCacheLock = &sync.Mutex{}
ocspResponseCache = make(map[certIDKey]*certCacheValue)
ocspParsedRespCache = make(map[parsedOcspRespKey]*ocspStatus)
if strings.EqualFold(os.Getenv(cacheServerEnabledEnv), "false") {
return
}
ocspResponseCache = make(map[certIDKey]*certCacheValue)
ocspParsedRespCache = make(map[parsedOcspRespKey]*ocspStatus)
ocspResponseCacheLock = &sync.RWMutex{}
ocspParsedRespCacheLock = &sync.Mutex{}

logger.Infof("reading OCSP Response cache file. %v\n", cacheFileName)
f, err := os.OpenFile(cacheFileName, os.O_CREATE|os.O_RDONLY, readWriteFileMode)
Expand Down

0 comments on commit cecf890

Please sign in to comment.