forked from quic-go/quic-go
move function to create the TLS key log file to a separate file
This commit is contained in:
@@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
@@ -13,6 +12,7 @@ import (
|
||||
"github.com/lucas-clemente/quic-go/http3"
|
||||
"github.com/lucas-clemente/quic-go/internal/testdata"
|
||||
"github.com/lucas-clemente/quic-go/interop/http09"
|
||||
"github.com/lucas-clemente/quic-go/interop/utils"
|
||||
)
|
||||
|
||||
var tlsConf *tls.Config
|
||||
@@ -26,15 +26,13 @@ func main() {
|
||||
defer logFile.Close()
|
||||
log.SetOutput(logFile)
|
||||
|
||||
var keyLog io.Writer
|
||||
if filename := os.Getenv("SSLKEYLOGFILE"); len(filename) > 0 {
|
||||
f, err := os.Create(filename)
|
||||
if err != nil {
|
||||
fmt.Printf("Could not create key log file: %s\n", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
defer f.Close()
|
||||
keyLog = f
|
||||
keyLog, err := utils.GetSSLKeyLog()
|
||||
if err != nil {
|
||||
fmt.Printf("Could not create key log: %s\n", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
if keyLog != nil {
|
||||
defer keyLog.Close()
|
||||
}
|
||||
|
||||
testcase := os.Getenv("TESTCASE")
|
||||
|
||||
Reference in New Issue
Block a user