khoadng / Boorusama

A mobile client for booru sites built with Flutter
GNU General Public License v3.0
165 stars 11 forks source link

Add HTTP/2, QUIC, VPN and Self-Signed CA support #464

Closed GGG-KILLER closed 18 hours ago

GGG-KILLER commented 1 week ago

This PR basically makes it so that all requests go through package:cronet_http (on Android) or package:cupertino_http (on MacOS/iOS) using package:native_dio_adapter.

From the package:native_dio_adapter page:

Using the native platform implementation, rather than the socket-based dart:io HttpClient implementation, has several advantages:

  • It automatically supports platform features such VPNs and HTTP proxies.
  • It supports many more configuration options such as only allowing access through WiFi and blocking cookies.
  • It supports more HTTP features such as HTTP/3 and custom redirect handling.

This enables us in the future to add support for blocking image loading outside of WiFi or metered connections, however I did not want to do more than needed in this PR.

This PR also changes the security settings for the app to allow user-added/user-installed CAs so that people can access their own self-hosted boorus that use self-signed certificates.

Fixes #463.

CLAassistant commented 1 week ago

CLA assistant check
All committers have signed the CLA.

khoadng commented 1 day ago

Looks good, I'll test on iOS/MacOS this weekend.