Index: net/third_party/nss/ssl/sslsock.c |
diff --git a/net/third_party/nss/ssl/sslsock.c b/net/third_party/nss/ssl/sslsock.c |
index 1823a1ca3faa0be49d628f006d3b1df8adf4fb44..2a93daedd0b07e61e9a8f50cff0d378a66ab95f0 100644 |
--- a/net/third_party/nss/ssl/sslsock.c |
+++ b/net/third_party/nss/ssl/sslsock.c |
@@ -2934,11 +2934,15 @@ ssl_SetDefaultsFromEnvironment(void) |
ev = getenv("SSLKEYLOGFILE"); |
if (ev && ev[0]) { |
ssl_keylog_iob = fopen(ev, "a"); |
- if (ftell(ssl_keylog_iob) == 0) { |
- fputs("# SSL/TLS secrets log file, generated by NSS\n", |
- ssl_keylog_iob); |
+ if (!ssl_keylog_iob) { |
+ SSL_TRACE(("Failed to open key log file")); |
+ } else { |
+ if (ftell(ssl_keylog_iob) == 0) { |
+ fputs("# SSL/TLS secrets log file, generated by NSS\n", |
+ ssl_keylog_iob); |
+ } |
+ SSL_TRACE(("SSL: logging pre-master secrets to %s", ev)); |
} |
- SSL_TRACE(("SSL: logging pre-master secrets to %s", ev)); |
} |
ev = getenv("SSLBYPASS"); |
if (ev && ev[0]) { |