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

Unified Diff: net/socket/ssl_client_socket_unittest.cc

Issue 1103603003: Gracefully handle NULL CertVerifiers in SSLClientSocket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@boringnss
Patch Set: Created 5 years, 8 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.cc ('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_unittest.cc
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc
index a41903efe1b1620487d61e16821ad299ad41a158..95907bb303a70701738ed0685bdca2e73c581be2 100644
--- a/net/socket/ssl_client_socket_unittest.cc
+++ b/net/socket/ssl_client_socket_unittest.cc
@@ -1231,6 +1231,17 @@ TEST_F(SSLClientSocketTest, ConnectClientAuthSendNullCert) {
EXPECT_FALSE(sock->IsConnected());
}
+TEST_F(SSLClientSocketTest, ConnectNoVerifier) {
+ context_.cert_verifier = nullptr;
+
+ SpawnedTestServer::SSLOptions ssl_options;
+ ASSERT_TRUE(ConnectToTestServer(ssl_options));
+ SSLConfig ssl_config;
+ int rv;
+ ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
+ EXPECT_EQ(ERR_CERT_INVALID, rv);
+}
+
// TODO(wtc): Add unit tests for IsConnectedAndIdle:
// - Server closes an SSL connection (with a close_notify alert message).
// - Server closes the underlying TCP connection directly.
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698