ladybird/Userland/Libraries/LibHTTP/HttpsJob.h
Linus Groh 6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00

43 lines
1.0 KiB
C++

/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/HashMap.h>
#include <LibCore/NetworkJob.h>
#include <LibCore/Stream.h>
#include <LibHTTP/HttpRequest.h>
#include <LibHTTP/HttpResponse.h>
#include <LibHTTP/Job.h>
#include <LibTLS/TLSv12.h>
namespace HTTP {
class HttpsJob final : public Job {
C_OBJECT(HttpsJob)
public:
virtual ~HttpsJob() override
{
}
bool received_client_certificates() const { return m_received_client_certificates.has_value(); }
Vector<TLS::Certificate> take_client_certificates() const { return m_received_client_certificates.release_value(); }
void set_certificate(DeprecatedString certificate, DeprecatedString key);
Function<Vector<TLS::Certificate>()> on_certificate_requested;
private:
explicit HttpsJob(HttpRequest&& request, Core::Stream::Stream& output_stream)
: Job(move(request), output_stream)
{
}
mutable Optional<Vector<TLS::Certificate>> m_received_client_certificates;
};
}