void Coder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
{
    if (!certificateInfo.certificate()) {
        encoder << false;
        return;
    }

    GByteArray* certificateData = 0;
    g_object_get(G_OBJECT(certificateInfo.certificate()), "certificate", &certificateData, NULL);
    if (!certificateData) {
        encoder << false;
        return;
    }

    encoder << true;

    GRefPtr<GByteArray> certificate = adoptGRef(certificateData);
    encoder << static_cast<uint64_t>(certificate->len);
    encoder.encodeFixedLengthData(certificate->data, certificate->len);

    encoder << static_cast<uint32_t>(certificateInfo.tlsErrors());
}
Exemplo n.º 2
0
void WebProcess::allowSpecificHTTPSCertificateForHost(const WebCore::CertificateInfo& certificateInfo, const String& host)
{
    ASSERT(!usesNetworkProcess());
    WebCore::ResourceHandle::setClientCertificate(host, certificateInfo.certificate());
}