[GH-ISSUE #549] Mkcert Certificates causes flutter cli tools to throw tls error #325

Closed
opened 2026-02-25 22:33:06 +03:00 by kerem · 3 comments
Owner

Originally created by @e-reifer on GitHub (Aug 21, 2023).
Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/549

Environment

  • Operating system (including version): macOS Ventura 13.4.1
  • mkcert version (from mkcert -version): v.1.4.4
  • Server (where the certificate is loaded):
  • Client (e.g. browser, CLI tool, or script): CLI (bin/bash)

What you did

What went wrong

Mkcerts prohibits the flutter cli to be able to get packages as the terminal browser uses the system-wide certitifacate generated by mkcert. I have not found a way to disable this.

flutter doctor shows this:
[!] Network resources ✗ A cryptographic error occurred while checking "https://pub.dev/": Handshake error in client You may be experiencing a man-in-the-middle attack, your network may be compromised, or you may have malware installed on your computer.

flutter pub get shows TLS error:

Got TLS error trying to find package args at https://pub.dev

Any help is appreciated

Originally created by @e-reifer on GitHub (Aug 21, 2023). Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/549 ## Environment * Operating system (including version): macOS Ventura 13.4.1 * mkcert version (from `mkcert -version`): v.1.4.4 * Server (where the certificate is loaded): * Client (e.g. browser, CLI tool, or script): CLI (bin/bash) ## What you did <!-- Including the `mkcert -install` step and how the certificate was generated and installed. --> ## What went wrong <!-- Please include the precise error, like a terminal transcript or a browser screenshot. --> Mkcerts prohibits the flutter cli to be able to get packages as the terminal browser uses the system-wide certitifacate generated by mkcert. I have not found a way to disable this. `flutter doctor` shows this: ` [!] Network resources ✗ A cryptographic error occurred while checking "https://pub.dev/": Handshake error in client You may be experiencing a man-in-the-middle attack, your network may be compromised, or you may have malware installed on your computer. ` `flutter pub get` shows TLS error: `Got TLS error trying to find package args at https://pub.dev` Any help is appreciated
kerem closed this issue 2026-02-25 22:33:06 +03:00
Author
Owner

@e-reifer commented on GitHub (Sep 4, 2023):

Could resolve it myself with the help of chatgpt. Mkcert was just a side effect. The real cause was me using dnsmasq service the unintentionally redirected all "pub.dev" results to localhost while using mkcert's certificate.

<!-- gh-comment-id:1705722474 --> @e-reifer commented on GitHub (Sep 4, 2023): Could resolve it myself with the help of chatgpt. Mkcert was just a side effect. The real cause was me using dnsmasq service the unintentionally redirected all "pub.dev" results to localhost while using mkcert's certificate.
Author
Owner

@coskuncay commented on GitHub (Feb 1, 2024):

hi @e-reifer , so how did you solve it ?

<!-- gh-comment-id:1920953690 --> @coskuncay commented on GitHub (Feb 1, 2024): hi @e-reifer , so how did you solve it ?
Author
Owner

@e-reifer commented on GitHub (Feb 1, 2024):

I've checked the dnsmasq.conf file /opt/homebrew/etc/dnsmasq.conf and deleted a line similar to address=/.dev/127.0.0.1

<!-- gh-comment-id:1921032807 --> @e-reifer commented on GitHub (Feb 1, 2024): I've checked the dnsmasq.conf file `/opt/homebrew/etc/dnsmasq.conf` and deleted a line similar to `address=/.dev/127.0.0.1`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mkcert#325
No description provided.