| Index: chrome/browser/cocoa/ssl_client_certificate_selector.mm
|
| diff --git a/chrome/browser/cocoa/ssl_client_certificate_selector.mm b/chrome/browser/cocoa/ssl_client_certificate_selector.mm
|
| index 48cb48a5195a643a40f22ce31e5a30c0a6af19b8..84a906c0bf18cea7bb9dbf92a32f51428be77b90 100644
|
| --- a/chrome/browser/cocoa/ssl_client_certificate_selector.mm
|
| +++ b/chrome/browser/cocoa/ssl_client_certificate_selector.mm
|
| @@ -20,6 +20,7 @@
|
| #include "chrome/browser/ssl/ssl_client_auth_handler.h"
|
| #include "chrome/browser/tab_contents/tab_contents.h"
|
| #include "grit/generated_resources.h"
|
| +#include "net/base/net_util.h"
|
| #include "net/base/x509_certificate.h"
|
|
|
| namespace {
|
| @@ -173,11 +174,18 @@ void ShowSSLClientCertificateSelector(
|
|
|
| // Create and set up a system choose-identity panel.
|
| SFChooseIdentityPanel* panel = [[SFChooseIdentityPanel alloc] init];
|
| - NSString* domain = base::SysUTF8ToNSString(
|
| - "https://" + certRequestInfo_->host_and_port);
|
| - // Setting the domain causes the dialog to record the preferred
|
| - // identity in the system keychain.
|
| - [panel setDomain:domain];
|
| + std::string host;
|
| + int port;
|
| + if (net::ParseHostAndPort(certRequestInfo_->host_and_port, &host, &port)) {
|
| + // Safari does not include the port number in its identity preferences, so
|
| + // similarly strip it off.
|
| + NSString* domain = base::SysUTF8ToNSString("https://" + host);
|
| + // Setting the domain causes the dialog to record the preferred
|
| + // identity in the system keychain.
|
| + [panel setDomain:domain];
|
| + } else {
|
| + NOTREACHED();
|
| + }
|
| [panel setInformativeText:message];
|
| [panel setDefaultButtonTitle:l10n_util::GetNSString(IDS_OK)];
|
| [panel setAlternateButtonTitle:l10n_util::GetNSString(IDS_CANCEL)];
|
|
|