dio_http_adapter 0.1.0+2
dio_http_adapter: ^0.1.0+2

Dart native
Flutter Android iOS

A customized dio HttpClientAdapter, to workaround the Host verification issue during SSL handshake.

dio_http_adapter #

Pub Check Status BSD

A customized dio HttpClientAdapter based on the dart:io package, to work around the "Hostname mismatch" issue when accessing URIs with an IP address (DNS over HTTP for example).

Usage #

Get an IP address of the 'pub.dev' site:

ping pub.dev
PING pub.dev (216.239.38.21) 56(84) bytes of data.
64 bytes from any-in-2615.1e100.net (216.239.38.21): icmp_seq=1 ttl=112 time=88.7 ms

Or using a dart package like dns

Access it using dio:

final dio = Dio(BaseOptions(
  baseUrl: 'https://216.239.38.21', // uses an IP address
  headers: <String, dynamic>{
    'host': 'pub.dev', // specifies the host name
  },
))..httpClientAdapter = IoHttpClientAdapter(); // uses the customized adapter

final resp = await dio.head('/');
0
likes
100
pub points
50%
popularity

Publisher

xinthink.com

A customized dio HttpClientAdapter, to workaround the Host verification issue during SSL handshake.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

Dependencies

dio, io_http, meta

More

Packages that depend on dio_http_adapter