Reviewed by Darin
[WebKit-https.git] / WebCore / platform / network / ProtectionSpace.cpp
index a6aa75ac1613477b410aa3dbb6a5cccbe22ab926..d0020c15d16bda225b821c9989a1e4b919a22d1c 100644 (file)
 #include "config.h"
 #include "ProtectionSpace.h"
 
+#include "AuthenticationCF.h"
+#include <CFNetwork/CFURLProtectionSpacePriv.h>
+#include <wtf/RetainPtr.h>
+
 namespace WebCore {
 
 // Need to enforce empty, non-null strings due to the pickiness of the String == String operator
@@ -81,10 +85,8 @@ ProtectionSpaceAuthenticationScheme ProtectionSpace::authenticationScheme() cons
 
 bool ProtectionSpace::receivesCredentialSecurely() const
 {
-    return (m_serverType == ProtectionSpaceServerHTTPS ||
-            m_serverType == ProtectionSpaceServerFTPS ||
-            m_serverType == ProtectionSpaceProxyHTTPS ||
-            m_authenticationScheme == ProtectionSpaceAuthenticationSchemeHTTPDigest);
+    RetainPtr<CFURLProtectionSpaceRef> cfSpace(AdoptCF, createCF(*this));
+    return cfSpace && CFURLProtectionSpaceReceivesCredentialSecurely(cfSpace.get());
 }
 
 bool operator==(const ProtectionSpace& a, const ProtectionSpace& b)