当前位置:网站首页>Dio问题总结
Dio问题总结
2022-07-26 19:18:00 【得食猫】
1. 添加代理
Dio dio = Dio(_options)
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
(client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
client.findProxy = (uri) {
if (proxyIP == null || proxyIP.isEmpty) {
return 'DIRECT';
}
return 'PROXY $proxyIP:$proxyPort';
};
return client;
};
2.CERTIFICATE_VERIFY_FAILED问题
项目运行时报了如下错误:
HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(handshake.cc:393))
解决方法:
Dio dio = Dio(_options)
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
(client) {
client.badCertificateCallback = (cert, host, port) {
return true;
};
};
边栏推荐
- Kingbases SQL language reference manual of Jincang database (15. SQL statement: create materialized view to create schema)
- Intensive reading of the paper: yolov2 - yolo9000: better, faster, stronger
- [shell] Reprint: batch replacement find awk sed xargs
- 银行业务分类
- Use of load balancing
- 学习Muduo中ChatRoom实现的各种细节和思考
- Svn - detailed documentation
- C#异步编程看这篇就够了
- 京东荣获中国智能科学技术最高奖!盘点京东体系智能技术
- 操作系统常见面试题目总结,含答案
猜你喜欢

Leetcode daily practice - 189. Rotation array

These 22 drawing (visualization) methods are very important and worth collecting!

企业数字化转型成大趋势,选对在线协作工具很重要

How to adjust the abnormal win11 USB drive to normal?

Intensive reading of the paper: yolov2 - yolo9000: better, faster, stronger

企业内部信息碎片化该怎么办?不妨试试这样做

2022年下半年(软考高级)信息系统项目管理师报名条件

数据库设计三大范式

一个开源的网页画板,真的太方便了

【Android】Kotlin 快速编译背后的黑科技,了解一下~
随机推荐
阿里三面:MQ 消息丢失、重复、积压问题,如何解决?
Docker使用mysql:5.6和 owncloud 镜像,构建一个个人网盘,安装搭建私有仓库 Harbor
Method of replacing Chinese characters with PHP
用 QuestPDF操作生成PDF更快更高效!
MySQL 子查询使用方式
十大排序详解
N圆最密堆积、最小外接正方形的matlab求解(二维、三维等圆Packing 问题)
一家芯片公司倒在了B轮
Where can I find the files downloaded from iPad
【MySQL】 - 索引原理与使用
一文读懂 .NET 中的高性能队列 Channel
金融机构盘点
Student‘s t分布
【Pytorch基础】torch.stack()函数解析
kvm虚拟化
ShardingSphere-JDBC 关键字问题
Latte dht-phev products are very popular. Will the sales volume make Li Ruifeng figure it out?
three.js 给地球加标签和弹窗
go+mysql+redis+vue3简单聊室,第6弹:使用vue3和element-plus调用接口
Ten sorting details