Skip to content

Commit 0eb6909

Browse files
committed
do not report an error if the clienthello cache file does not exist
1 parent b026e91 commit 0eb6909

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

chained/tls_config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ func getBrowserHello(ctx context.Context, configDir string, uc common.UserConfig
139139
if err == nil {
140140
return *hello
141141
}
142-
op.FailIf(err)
143142
log.Debugf("failed to actively obtain browser hello: %v", err)
144143

145144
// Our last option is to simulate a browser choice for the user based on market share.

chained/tls_config_other.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ func cachedHello(configDir string) (*helloSpec, error) {
2121
if err == nil {
2222
return &helloSpec{tls.HelloCustom, sample}, nil
2323
}
24-
return nil, fmt.Errorf("%w", err)
24+
return nil, fmt.Errorf("Could not read hello cache file: %w", err)
2525
}
2626

2727
// ActivelyObtainBrowserHello obtains a sample TLS ClientHello via listening
2828
// for local traffic.
2929
func ActivelyObtainBrowserHello(ctx context.Context, configDir string) (*helloSpec, error) {
3030
sample, err := hellocap.GetDefaultBrowserHello(ctx)
3131
if err != nil {
32-
return nil, fmt.Errorf("%w", err)
32+
return nil, fmt.Errorf("Could not get default browser hello: %w", err)
3333
}
3434
helloCacheFile := filepath.Join(configDir, helloCacheFilename)
3535
if err := os.WriteFile(helloCacheFile, sample, 0644); err != nil {
36-
log.Debugf("failed to write actively obtained hello to cache: %v", err)
36+
return nil, fmt.Errorf("failed to write actively obtained hello to cache: %w", err)
3737
} else {
3838
log.Debugf("wrote actively obtained hello to cache")
3939
}

0 commit comments

Comments
 (0)