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

Unified Diff: net/base/x509_openssl_util.cc

Issue 5195001: Fixes the remaining net_unittests for OpenSSL, with the exceptions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarify comment Created 10 years, 1 month 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/base/x509_openssl_util.cc
diff --git a/net/base/x509_openssl_util.cc b/net/base/x509_openssl_util.cc
index 9e44c4b8d5750e7b6a856f0e55f245affb8282a5..d28a4dc305261cd8b66f7aa9ffb3e53ebbf0a014 100644
--- a/net/base/x509_openssl_util.cc
+++ b/net/base/x509_openssl_util.cc
@@ -149,8 +149,16 @@ bool VerifyHostname(const std::string& hostname,
}
DCHECK(!reference_name.empty());
- // TODO(joth): Add IP address support. See http://crbug.com/62973
if (found_ip6_chars || !found_alpha) {
+ // For now we just do simple localhost IP address support, primarily as
+ // it's needed by the test server. TODO(joth): Replace this with full IP
+ // address support. See http://crbug.com/62973
+ if (hostname == "127.0.0.1" &&
+ std::find(cert_names.begin(), cert_names.end(), hostname)
+ != cert_names.end()) {
wtc 2010/12/01 22:50:05 Nit: Chromium's style guide recommend folding long
joth 2010/12/02 17:12:01 Done.
+ DVLOG(1) << "Allowing localhost IP certificate: " << hostname;
+ return true;
+ }
NOTIMPLEMENTED() << hostname;
return false;
}

Powered by Google App Engine
This is Rietveld 408576698