Cloud and Software Architecture, Soft skills, IOT and embedded
Flutter mobile - certificate and SSL exclusions for development domains
Get link
Facebook
X
Pinterest
Email
Other Apps
Flutter mobile development gets twisty when working behind corporate firewalls and with self-signed development certificates. We look at a bit of code that can be used in debug builds that sets the emulator/simulator proxies and disables cert checks.
You can use this sample code wrapped in an `if (isKDebug)` when running Flutter on mobile. It lets you exclude your self-signed certificates for your internal domains while leaving certificate checks enabled for production and external domains. The code also sets the proxy when running in the Android Emulator or the iOS Simulator. Setting the proxy is optional, enabled when you pass in the proxy port.
import'dart:io';
///
/// Ignores certificates in developermode for limited set of domains
/// Simplifies development in corporate self signed environment
/// Configures the emulator or simulator proxy if passed proxy port.
/// Assumes there is a proxy running locally if proxy port provided
/// Proxy only used for mobile devices. We assume browser is already configured.
///
classDevelopmentHttpConfigextendsHttpOverrides {
DevelopmentHttpConfig({
requiredthis.certExclusionDomains,
this.iosProxyHost='127.0.0.1',
this.androidProxyHost='10.0.2.2',
this.proxyPort,
});
/// Proxy used for android
/// Defaults to the 10.0.2.x network
StringandroidProxyHost;
/// Proxy used for IOS because it uses the host network. defaults to 127.0.0.1
/// Android has its own network
StringiosProxyHost;
/// list of domains we exclude from cert check
List<String> certExclusionDomains;
/// proxyPort != null means setup the proxy if isAndroid or isIOS
I've worked in corporate environments where the Android 10.0.2.1 doesn't work for reaching sites and I have to use the corporate proxy instead.
Example usage from test case
Here are two test cases. "wrong.host.badssl.com" is a test site with a bad certificate. We test connecting to it with that domain in our "do not check list" and again with it not in the list.
I do a lot of my development and configuration via ssh into my Raspberry Pi Zero over the RNDIS connection. Some models of the Raspberry PIs can be configured with gadget drivers that let the Raspberry pi emulate different devices when plugged into computers via USB. My favorite gadget is the network profile that makes a Raspberry Pi look like an RNDIS-attached network device. All types of network services travel over an RNDIS device without knowing it is a USB hardware connection. A Raspberry Pi shows up as a Remote NDIS (RNDIS) device when you plug the Pi into a PC or Mac via a USB cable. The gadget in the Windows Device Manager picture shows this RNDIS Gadget connectivity between a Windows machine and a Raspberry Pi. The Problem Windows 11 and Windows 10 no longer auto-installs the RNDIS driver that makes magic happen. Windows recognizes that the Raspberry Pi is some type of generic USB COM device. Manually running W indows Update or Upd...
MLX is an ML framework targeted at Apple Silicon. It provides noticeable ML performance gains when compared to the standard (GGUF) techniques running on Apple Silicon. This MLX project describes MLX as: MLX is an array framework for machine learning on Apple silicon, brought to you by Apple machine learning research. A notable difference from MLX and other frameworks is the unified memory model . Arrays in MLX live in shared memory. Operations on MLX arrays can be performed on any of the supported device types without transferring data. LM Studio added support for Apple Silicon MLX models in 2024 . I totally ignored it until I saw a 2025/02 Reddit post in the /r/ocallama subreddit . I wanted to execute their microbenchmark on my Mac to get a feel for the possible performance difference. The performance improvement is exciting. I am waiting on really jumping into the MLX until Ollama supports MLX something they are working on as of 2025/0...
We have Verizon FIOS with cable TV service. I've never really paid attention to how the Verizon side is wired up until Verizon recently upgraded my FIOS router and tuner box. After breaking my TV tuner by disconnecting an " unneeded" connection, I created yet another diagram of how the FIOS connections work. This is a basic wiring diagram of the house network missing a bunch of devices. Verizon ONT The Verizon optical network terminal converts the optical connection into TV and network standard connections. The ONT is actually two boxes in my situation. One outside connects to the optical and one inside converts something into an Ethernet WAN connection. This results in me connecting a TV COAX and an Ethernet WAN. Verizon TV Tuner The Verizon TV tuner decodes and decrypts TV data that it receives over coax. The TV tuner must talk back to Verizon for any video control operations. It could talk back wireless, over an extra ethernet connection to back over th...
Comments
Post a Comment