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

Unified Diff: runtime/bin/secure_socket.cc

Issue 11553027: Add client certificates to HttpsServer and HttpClient. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove two stray lines. Created 8 years 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 | « runtime/bin/secure_socket.h ('k') | sdk/lib/io/http.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/secure_socket.cc
diff --git a/runtime/bin/secure_socket.cc b/runtime/bin/secure_socket.cc
index c3786837cd671fb70e236113e6f39a7a3b6e6aaa..d270c4734e2c68d79446d2bd3c5ce6babf6ac58b 100644
--- a/runtime/bin/secure_socket.cc
+++ b/runtime/bin/secure_socket.cc
@@ -412,6 +412,10 @@ void SSLFilter::Connect(const char* host_name,
ThrowException("Connect called while already in handshake state.");
}
+ if (!is_server && certificate_name != NULL) {
+ client_certificate_name_ = strdup(certificate_name);
+ }
+
filter_ = SSL_ImportFD(NULL, filter_);
if (filter_ == NULL) {
ThrowPRException("Failed SSL_ImportFD call");
@@ -481,7 +485,7 @@ void SSLFilter::Connect(const char* host_name,
status = SSL_GetClientAuthDataHook(
filter_,
NSS_GetClientAuthData,
- static_cast<void*>(const_cast<char*>(certificate_name)));
+ static_cast<void*>(client_certificate_name_));
if (status != SECSuccess) {
ThrowPRException("Failed SSL_GetClientAuthDataHook call");
}
@@ -552,6 +556,7 @@ void SSLFilter::Destroy() {
if (bad_certificate_callback_ != NULL) {
Dart_DeletePersistentHandle(bad_certificate_callback_);
}
+ free(client_certificate_name_);
PR_Close(filter_);
}
« no previous file with comments | « runtime/bin/secure_socket.h ('k') | sdk/lib/io/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698