IgnoreCertError should check if the error is a certificate error.

This only affects one of the two callers. --ignore-certificate-error ends up
causing some metrics to record on all errors rather than just certificate ones,
so we end up recording things based on a default-initialized SSLInfo.

BUG=none

Review URL: https://codereview.chromium.org/947453003

Cr-Commit-Position: refs/heads/master@{#317442}
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index 64b6d67..870be34 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -499,7 +499,8 @@
                                100);
 
     SSLInfo ssl_info;
-    ssl_socket_->GetSSLInfo(&ssl_info);
+    bool has_ssl_info = ssl_socket_->GetSSLInfo(&ssl_info);
+    DCHECK(has_ssl_info);
 
     UMA_HISTOGRAM_ENUMERATION("Net.SSLVersion", SSLConnectionStatusToVersion(
                                                     ssl_info.connection_status),