Fix secure websocket (wss) on Mac.
Fix secure websocket (wss) on Mac.

When SSLClientSocket of Mac reports certificate error (e.g. ERR_CERT_AUTHORITY_INVALID), it hasn't finish the SSL handshake and doesn't report the socket is connected.
So, even if we tricks the result from SSLClientSocket::Connect by HandleCertificateError, it will be handled as ERR_CONNECTION_FAILED because socket_->IsConnected() is false.

So, when SSLClientSocket::Connect reported certificate error and socket_->IsConnectedAndIdle() is false, get the certificate and retry establishing connection again with the certificate in allowed bad certificates, so we could ignore the certificate verify error.

Without this fix, websocket live experiment on mac always fails for secure connection.

BUG=32569
TEST=try open wss: connection and got open events.

Review URL: http://codereview.chromium.org/543111

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@36519 0039d316-1c4b-4281-b951-d872f2087c98

ltilve/chromium,patrickm/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,ondra-novak/chromium.src,nacl-webkit/chrome_deps,dushu1203/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,patrickm/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,rogerwang/chromium,dednal/chromium.src,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,M4sse/chromium.src,keishi/chromium,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,ltilve/chromium,M4sse/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,robclark/chromium,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,patrickm/chromium.src,chuan9/chromium-crosswalk,rogerwang/chromium,mohamed--abdel-maksoud/chromium.src,keishi/chromium,littlstar/chromium.src,anirudhSK/chromium,dednal/chromium.src,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,keishi/chromium,timopulkkinen/BubbleFish,ltilve/chromium,Just-D/chromium-1,dushu1203/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,hujiajie/pa-chromium,littlstar/chromium.src,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,keishi/chromium,pozdnyakov/chromium-crosswalk,keishi/chromium,Chilledheart/chromium,M4sse/chromium.src,Chilledheart/chromium,zcbenz/cefode-chromium,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,zcbenz/cefode-chromium,robclark/chromium,anirudhSK/chromium,anirudhSK/chromium,jaruba/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,nacl-webkit/chrome_deps,robclark/chromium,dushu1203/chromium.src,ltilve/chromium,krieger-od/nwjs_chromium.src,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,dednal/chromium.src,ltilve/chromium,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,keishi/chromium,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,rogerwang/chromium,Jonekee/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,littlstar/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,rogerwang/chromium,krieger-od/nwjs_chromium.src,robclark/chromium,littlstar/chromium.src,bright-sparks/chromium-spacewalk,ltilve/chromium,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,anirudhSK/chromium,Chilledheart/chromium,rogerwang/chromium,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,rogerwang/chromium,nacl-webkit/chrome_deps,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,anirudhSK/chromium,patrickm/chromium.src,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk,M4sse/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,robclark/chromium,dushu1203/chromium.src,ondra-novak/chromium.src,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,rogerwang/chromium,zcbenz/cefode-chromium,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,robclark/chromium,hujiajie/pa-chromium,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,timopulkkinen/BubbleFish,hujiajie/pa-chromium,dednal/chromium.src,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,keishi/chromium,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,dednal/chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,keishi/chromium,littlstar/chromium.src,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,rogerwang/chromium,junmin-zhu/chromium-rivertrail,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,robclark/chromium,M4sse/chromium.src,dednal/chromium.src,Jonekee/chromium.src,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,Jonekee/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,M4sse/chromium.src,patrickm/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,robclark/chromium,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,littlstar/chromium.src,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,markYoungH/chromium.src,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,keishi/chromium,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,M4sse/chromium.src,bright-sparks/chromium-spacewalk,jaruba/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,Chilledheart/chromium,robclark/chromium,axinging/chromium-crosswalk,axinging/chromium-crosswalk,zcbenz/cefode-chromium,dednal/chromium.src,jaruba/chromium.src,zcbenz/cefode-chromium,jaruba/chromium.src,chuan9/chromium-crosswalk,anirudhSK/chromium,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,patrickm/chromium.src,keishi/chromium,crosswalk-project/chromium-crosswalk-efl,keishi/chromium,markYoungH/chromium.src,ondra-novak/chromium.src,dushu1203/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,robclark/chromium,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,rogerwang/chromium,patrickm/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,rogerwang/chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src