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

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: 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
« no previous file with comments | « net/socket/ssl_client_socket_openssl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d8a9446efb95bc8ac783d222fc070b529bb0ead9 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -16,7 +16,6 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
-#include "base/environment.h"
#include "base/lazy_instance.h"
#include "base/memory/singleton.h"
#include "base/metrics/histogram_macros.h"
@@ -245,20 +244,6 @@ class SSLClientSocketOpenSSL::SSLContext {
SSL_CTX_set_session_cache_mode(
ssl_ctx_.get(), SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_NO_INTERNAL);
SSL_CTX_sess_set_new_cb(ssl_ctx_.get(), NewSessionCallback);
-
- scoped_ptr<base::Environment> env(base::Environment::Create());
- std::string ssl_keylog_file;
- if (env->GetVar("SSLKEYLOGFILE", &ssl_keylog_file) &&
- !ssl_keylog_file.empty()) {
- 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(ssl_ctx_.get(), bio);
- }
- }
}
static int ClientCertRequestCallback(SSL* ssl, void* arg) {
@@ -472,6 +457,18 @@ SSLClientSocketOpenSSL::~SSLClientSocketOpenSSL() {
Disconnect();
}
+void SSLClientSocketOpenSSL::SetSSLKeyLogFile(
+ const std::string& ssl_keylog_file) {
+ 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_;
« no previous file with comments | « 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