| Index: runtime/bin/secure_socket.cc
|
| diff --git a/runtime/bin/secure_socket.cc b/runtime/bin/secure_socket.cc
|
| index d29e7cfc9c065f8c2608d1cb07acd29e6f410c92..4d3c67997e053a4c37c2baecaef10be542018780 100644
|
| --- a/runtime/bin/secure_socket.cc
|
| +++ b/runtime/bin/secure_socket.cc
|
| @@ -433,7 +433,7 @@ void FUNCTION_NAME(SecurityContext_SetTrustedCertificates)(
|
| directory = NULL;
|
| } else {
|
| Dart_ThrowException(DartUtils::NewDartArgumentError(
|
| - "Directory argument to SecurityContext.usePrivateKey is not "
|
| + "Directory argument to SecurityContext.setTrustedCertificates is not "
|
| "a String or null"));
|
| }
|
|
|
| @@ -910,9 +910,12 @@ void SSLFilter::Connect(const char* hostname,
|
| SSL_set_ex_data(ssl_, filter_ssl_index, this);
|
|
|
| if (is_server_) {
|
| - // Do not request a client certificate.
|
| - // TODO(24069): Allow server to request a client certificate, when desired.
|
| - SSL_set_verify(ssl_, SSL_VERIFY_NONE, NULL);
|
| + int certificate_mode =
|
| + request_client_certificate ? SSL_VERIFY_PEER : SSL_VERIFY_NONE;
|
| + if (require_client_certificate) {
|
| + certificate_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
|
| + }
|
| + SSL_set_verify(ssl_, certificate_mode, NULL);
|
| } else {
|
| SetAlpnProtocolList(protocols_handle, ssl_, NULL, false);
|
| status = SSL_set_tlsext_host_name(ssl_, hostname);
|
| @@ -948,19 +951,6 @@ void SSLFilter::Connect(const char* hostname,
|
| if (SSL_LOG_STATUS) Log::Print("SSL_connect error: %d\n", error);
|
| }
|
| }
|
| - if (is_server_) {
|
| - if (request_client_certificate) {
|
| - // TODO(24069): Handle client certificates on server side.
|
| - Dart_ThrowException(DartUtils::NewDartArgumentError(
|
| - "requestClientCertificate not implemented."));
|
| - }
|
| - } else { // Client.
|
| - if (send_client_certificate) {
|
| - // TODO(24070): Handle client certificates on client side.
|
| - Dart_ThrowException(DartUtils::NewDartArgumentError(
|
| - "sendClientCertificate not implemented."));
|
| - }
|
| - }
|
| Handshake();
|
| }
|
|
|
|
|