我正在try 使用自签名证书连接服务器,但出现错误:
String path = '/storage/sdcard0/server.crt';
SecurityContext context = new SecurityContext();
context.setTrustedCertificates(path, password: 'hello');
_client = new HttpClient(context: context);
我做错了什么?
如果我没有设置SecurityContext,我会收到SSL握手错误.