Previously all attempts to open a `SSLKEYLOGFILE` would result in a
"unable to open keylog file" regardless of if the file was opened or
not. Instead let's only report the issue if the file fails to open.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
keylogfile = secure_getenv("SSLKEYLOGFILE");
if (keylogfile != NULL && *keylogfile != '\0') {
keylog = fopen(keylogfile, "ae");
- _gnutls_debug_log("unable to open keylog file %s\n",
- keylogfile);
+ if (keylog == NULL)
+ _gnutls_debug_log(
+ "unable to open keylog file %s, error %d\n",
+ keylogfile, errno);
}
}