我面临着 Flutter Web 的第一个大问题。
我必须通过对具有自签名 ssl 证书的服务器的后期调用来使用 oauth2 登录。
使用 http 和 dio 客户端发出请求,我收到 net::ERR_CERT_AUTHORITY_INVALID。我在网上找到的唯一方法是使用 HttpClient,它适用于 android 和 IO,但 dart:io 在网络构建中不起作用。有没有办法信任我的 flutter web ssl 证书?
// My simple line of code
var response = await client.post(authorizationEndpoint.toString(), body: body, headers: headers);
// What I am looking for
var response = await client.post(authorizationEndpoint.toString(),
body: body, headers: headers,
---> trustanyCA: true);
Run Code Online (Sandbox Code Playgroud)