Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Unified Diff: net/socket/nss_ssl_util.cc

Issue 494913002: Include better OpenSSL error information in NetLog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/socket/nss_ssl_util.cc
diff --git a/net/socket/nss_ssl_util.cc b/net/socket/nss_ssl_util.cc
index 7b068545a55290b6368816a992cca3f7161d720e..a238a25d2d4be95623fead070880556aa2c7aa64 100644
--- a/net/socket/nss_ssl_util.cc
+++ b/net/socket/nss_ssl_util.cc
@@ -29,6 +29,8 @@
#include "base/win/windows_version.h"
#endif
+namespace net {
+
namespace {
// CiphersRemove takes a zero-terminated array of cipher suite ids in
@@ -77,9 +79,15 @@ size_t CiphersCopy(const uint16* in, uint16* out) {
}
}
-} // anonymous namespace
-
-namespace net {
+base::Value* NetLogSSLErrorCallback(int net_error,
+ int ssl_lib_error,
+ NetLog::LogLevel /* log_level */) {
+ base::DictionaryValue* dict = new base::DictionaryValue();
+ dict->SetInteger("net_error", net_error);
+ if (ssl_lib_error)
+ dict->SetInteger("ssl_lib_error", ssl_lib_error);
+ return dict;
Ryan Sleevi 2014/08/25 06:24:35 Should you also call PR_GetErrorText (noting PR_G
davidben 2014/08/26 22:13:51 Eh, this just came from net/socket/ssl_error_param
+}
class NSSSSLInitSingleton {
public:
@@ -201,9 +209,11 @@ class NSSSSLInitSingleton {
PRFileDesc* model_fd_;
};
-static base::LazyInstance<NSSSSLInitSingleton>::Leaky g_nss_ssl_init_singleton =
+base::LazyInstance<NSSSSLInitSingleton>::Leaky g_nss_ssl_init_singleton =
LAZY_INSTANCE_INITIALIZER;
+} // anonymous namespace
+
// Initialize the NSS SSL library if it isn't already initialized. This must
// be called before any other NSS SSL functions. This function is
// thread-safe, and the NSS SSL library will only ever be initialized once.
@@ -399,4 +409,9 @@ void LogFailedNSSFunction(const BoundNetLog& net_log,
function, param, PR_GetError()));
}
+NetLog::ParametersCallback CreateNetLogSSLErrorCallback(int net_error,
+ int ssl_lib_error) {
+ return base::Bind(&NetLogSSLErrorCallback, net_error, ssl_lib_error);
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698