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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 1403863002: Enable exporting SSLKEYLOGFILE on Android w/ command line arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: openssl envrironment Created 5 years, 2 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/ssl_client_socket_openssl.cc
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index 1e0d799e6a731167e86489a9449142eb78752a91..f5a260c64749b2db6073ca5f4eb01a17d82b0684 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -472,6 +472,24 @@ SSLClientSocketOpenSSL::~SSLClientSocketOpenSSL() {
Disconnect();
}
+void SSLClientSocketOpenSSL::SetSslKeyLogFile(std::string ssl_keylog_file) {
+ std::string env_keylog_file;
+ scoped_ptr<base::Environment> env(base::Environment::Create());
Bryan McQuade 2015/10/14 00:38:54 I think there's some benefit to centralizing the l
+ if (env->GetVar("SSLKEYLOGFILE", &env_keylog_file) &&
+ !env_keylog_file.empty()) {
+ return;
+ }
+
+ crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
+ BIO* bio = BIO_new_file(ssl_keylog_file.c_str(), "a");
+ if (!bio) {
+ LOG(ERROR) << "Failed to open " << ssl_keylog_file;
+ ERR_print_errors_cb(&LogErrorCallback, NULL);
+ } else {
+ SSL_CTX_set_keylog_bio(SSLContext::GetInstance()->ssl_ctx(), bio);
+ }
+}
+
void SSLClientSocketOpenSSL::GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) {
cert_request_info->host_and_port = host_and_port_;
« net/socket/ssl_client_socket_openssl.h ('K') | « net/socket/ssl_client_socket_openssl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698