0

尝试使用以下代码连接月球。有人可以帮我吗? Microsoft.Playwright.PlaywrightException: unable to verify the first certificate Using Playwright

轨迹追踪:

onnection.SendMessageToServerAsync[T](String guid, String method, Object args)
    BrowserType.ConnectAsync(String wsEndpoint, BrowserTypeConnectOptions options)
    MoonDotNetCore.InitiateMoonWebDriver() line 68
    GenericAdapter`1.BlockUntilCompleted()
    NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaitable)
    AsyncToSyncAdapter.Await(Func`1 invoke)
    SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, MethodInfo method)
    SetUpTearDownItem.RunSetUp(TestExecutionContext context)
    <.ctor>b__0(TestExecutionContext context)
    <>c__DisplayClass1_0.<Execute>b__0()
    BeforeAndAfterTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)

代码:

Dictionary<string, string> moonOptions = new Dictionary<string, string>();
moonOptions.Add("Http","--ignore-certificate-errors");
BrowserTypeConnectOptions launchOptions = new BrowserTypeConnectOptions() {
    Headers = moonOptions
};
var playwright = await Playwright.CreateAsync();
await playwright.Chromium.ConnectAsync("wss://moon.url.com/wd/hub", launchOptions);
4

0 回答 0