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

Unified Diff: runtime/bin/secure_socket.cc

Issue 1384463003: Enable SNI hostname extension in SecureSocket. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | 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 af90fabb7c4759cbc8c9f426722feb42ad115a3a..b974f9007a0af55b5489b7af0ce536b09fa3a2a0 100644
--- a/runtime/bin/secure_socket.cc
+++ b/runtime/bin/secure_socket.cc
@@ -875,11 +875,7 @@ void SSLFilter::Connect(const char* hostname,
status = BIO_new_bio_pair(&ssl_side, 10000, &socket_side_, 10000);
CheckStatus(status, "BIO_new_bio_pair", __LINE__);
- if (context == NULL) {
- DART_CHECK_VALID(Dart_ThrowException(DartUtils::NewDartArgumentError(
- "Default SecurityContext not implemented, context cannot be null.")));
- }
-
+ assert(context != NULL);
ssl_ = SSL_new(context);
SSL_set_bio(ssl_, ssl_side, ssl_side);
SSL_set_mode(ssl_, SSL_MODE_AUTO_RETRY); // TODO(whesse): Is this right?
@@ -891,6 +887,8 @@ void SSLFilter::Connect(const char* hostname,
SSL_set_verify(ssl_, SSL_VERIFY_NONE, NULL);
} else {
SetAlpnProtocolList(protocols_handle, ssl_, NULL, false);
+ status = SSL_set_tlsext_host_name(ssl_, hostname);
+ CheckStatus(status, "Set SNI host name", __LINE__);
// Sets the hostname in the certificate-checking object, so it is checked
// against the certificate presented by the server.
X509_VERIFY_PARAM* certificate_checking_parameters = SSL_get0_param(ssl_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698