mi·do·naミ・ド・ナ

Home / Library / Help / Reaching a local model over HTTPS

Troubleshooting

Reaching a local model over HTTPS

If mi·do·na is served over HTTPS, the browser may refuse to let it reach a local model running on plain http://localhost. When that happens, wrap your local server in a locally-trusted HTTPS proxy so the browser talks HTTPS the whole way. This works for any of the runners - LM Studio, Ollama, llama.cpp, koboldcpp - since only the port changes.

When you need this

A page loaded over HTTPS isn't allowed to make plain-HTTP requests - the browser blocks the mix. Your local runner serves plain HTTP on localhost, so an HTTPS copy of mi·do·na can't reach it directly.

Safari enforces this most strictly, which is why it's the usual trigger. Chrome and Firefox are more lenient about localhost, and any http:// copy of mi·do·na reaches it with no trouble. So this is one specific fix for one specific situation - not something everyone needs.

The fix is to put a small HTTPS proxy in front of your runner: mi·do·na talks HTTPS to the proxy, the proxy talks HTTP to your runner, all on your own machine.

Find your runner's port

You'll forward the proxy to whatever port your runner already serves on. The defaults:

LM StudioDefault port
1234 · serves http://localhost:1234
OllamaDefault port
11434 · serves http://localhost:11434
llama.cppDefault port
8080 · serves http://localhost:8080
koboldcppDefault port
5001 · serves http://localhost:5001

In the commands below, replace PORT with your runner's port. New to running a model? Start with Set up your model runner.

Wrap it with a trusted HTTPS proxy (macOS example)

Install the tools with Homebrew:

Terminal
brew install mkcert nss node
mkdir /path/to/local-proxy
cd /path/to/local-proxy
npm install -g local-ssl-proxy

Trust a local CA and mint a localhost cert:

Terminal
mkcert -install

A keytool "Keystore file does not exist" error here can be ignored. Then:

Terminal
mkcert localhost

If you hit the keystore error again, try:

Terminal
TRUST_STORES=system,nss mkcert localhost

This writes localhost.pem and localhost-key.pem to the current directory. Now run the proxy: HTTPS in on 8443, forwarding to your runner on PORT:

Terminal

local-ssl-proxy --source 8443 --target PORT --cert localhost.pem --key localhost-key.pem

Your runner is now reachable at https://localhost:8443 with a cert the browser trusts.

Connect mi·do·na

In the connection panel, set the API endpoint to https://localhost:8443 (the proxy's HTTPS port) and load models. See Connect a model.

This is one tested way to do it on macOS. Other approaches - a different proxy, a browser exception - can work too; this is a reliable starting point.

Only needed for HTTPS pages that the browser won't let reach localhost, most often in Safari. Chrome and Firefox, and any http:// page, reach localhost directly.