The tls.Config needs a writer to output the ssl debug key which helps debug and decrypts the packets and the writer is a io.Writer.
So I wrapped one struct like this:
type SslKeyLog struct{}
func (s SslKeyLog) Write(p []byte) (n int, err error) {
file, err := os.OpenFile(sslLogFile, os.O_RDWR|os.O_CREATE, 0755)
if err != nil {
fmt.Printf("failed to open file: %s\n", sslLogFile)
return 0, err
}
return file.Write(p)
}
But actually I can open one file and pass it directly:
The
tls.Config
needs a writer to output the ssl debug key which helps debug and decrypts the packets and the writer is aio.Writer
. So I wrapped one struct like this:But actually I can open one file and pass it directly: