diff --git a/Ladybird/WebDriver/main.cpp b/Ladybird/WebDriver/main.cpp index ba29a44a54..8e678357ed 100644 --- a/Ladybird/WebDriver/main.cpp +++ b/Ladybird/WebDriver/main.cpp @@ -16,6 +16,8 @@ #include #include +static Vector certificates; + static ErrorOr launch_process(StringView application, ReadonlySpan arguments) { auto paths = TRY(get_paths_for_helper_process(application)); @@ -32,12 +34,20 @@ static ErrorOr launch_process(StringView application, ReadonlySpan launch_browser(ByteString const& socket_path) { - return launch_process("Ladybird"sv, - Array { - "--webdriver-content-path", - socket_path.characters(), - "about:blank", - }); + auto arguments = Vector { + "--webdriver-content-path", + socket_path.characters(), + }; + + Vector certificate_args; + for (auto const& certificate : certificates) { + certificate_args.append(ByteString::formatted("--certificate={}", certificate)); + arguments.append(certificate_args.last().view().characters_without_null_termination()); + } + + arguments.append("about:blank"); + + return launch_process("Ladybird"sv, arguments.span()); } static ErrorOr launch_headless_browser(ByteString const& socket_path) @@ -63,6 +73,7 @@ ErrorOr serenity_main(Main::Arguments arguments) Core::ArgsParser args_parser; args_parser.add_option(listen_address, "IP address to listen on", "listen-address", 'l', "listen_address"); args_parser.add_option(port, "Port to listen on", "port", 'p', "port"); + args_parser.add_option(certificates, "Path to a certificate file", "certificate", 'C', "certificate"); args_parser.parse(arguments); auto ipv4_address = IPv4Address::from_string(listen_address);