move function to create the TLS key log file to a separate file

This commit is contained in:
Marten Seemann
2020-02-12 11:48:31 +07:00
parent dd035c2f12
commit 89728126cc
3 changed files with 37 additions and 20 deletions

19
interop/utils/logging.go Normal file
View File

@@ -0,0 +1,19 @@
package utils
import (
"io"
"os"
)
// GetSSLKeyLog creates a file for the TLS key log
func GetSSLKeyLog() (io.WriteCloser, error) {
filename := os.Getenv("SSLKEYLOGFILE")
if len(filename) == 0 {
return nil, nil
}
f, err := os.Create(filename)
if err != nil {
return nil, err
}
return f, nil
}