---
title: ".NET | Speedscale Docs"
description: ".NET guidance for Speedscale and proxymock, including proxy setup, TLS trust, demo app details, and a first-success workflow."
canonical: "https://docs.speedscale.com/reference/languages/dotnet/"
---

[Documentation index](https://docs.speedscale.com/reference/llms.txt) | [Markdown](https://docs.speedscale.com/reference/languages/dotnet/index.md) | [Canonical page](https://docs.speedscale.com/reference/languages/dotnet/)

# .NET

.NET is fully supported by Speedscale. Use this page for .NET-specific proxy settings, TLS trust configuration, demo guidance, and the proxymock local workflow.

*   Support matrix: [Technology Support](https://docs.speedscale.com/reference/technology-support/)
*   Shared proxymock proxy reference: [Language Configuration](https://docs.speedscale.com/proxymock/getting-started/language-reference/)

<a id="kubernetes-sidecar"></a>

## Kubernetes Sidecar

When .NET runs with the Speedscale sidecar in `forward` or `dual` mode, configure outbound traffic to use the sidecar's forward proxy on `127.0.0.1:4140` unless you changed `proxy-out-port`.

Typical settings:

```bash
export HTTP_PROXY=http://127.0.0.1:4140
export HTTPS_PROXY=http://127.0.0.1:4140
```

If `tls-out` is enabled, trust the Speedscale CA separately, commonly with `SSL_CERT_FILE` on Linux-based .NET containers.

See [Proxy Modes](https://docs.speedscale.com/getting-started/installation/sidecar/proxy-modes/) and [TLS Support](https://docs.speedscale.com/getting-started/installation/sidecar/tls/) for the shared sidecar behavior.

<a id="demo-app"></a>

## Demo App

*   Public demo: [speedscale/mock-lab](https://github.com/speedscale/mock-lab) (`languages/dotnet` directory)
*   Stack: .NET minimal API that calls one downstream, the CNCF projects API at `https://demo-api.trafficreplay.com`
*   Local run: `dotnet run`
*   Quick validation: `./lab/tests/run_tests.sh --recording`

This is the current public .NET demo used for local proxymock examples.

<a id="proxymock"></a>

## proxymock

Run the .NET demo from a macOS or Linux shell. For native Windows, install proxymock from the Windows tab of the installation page and see Windows TLS trust below.

1.  1. Install and initialize proxymock
    
    ```
    brew install speedscale/tap/proxymock
    proxymock init
    ```
    
    Use browser sign-in by default. Use \`proxymock init --api-key <your key>\` only for CI or other headless environments.
    
2.  2. Start recording
    
    ```
    git clone https://github.com/speedscale/mock-lab
    cd mock-lab/languages/dotnet
    proxymock record -- dotnet run
    ```
    
    proxymock starts the .NET service as a child process and sets its proxy and TLS environment variables. On macOS and native Windows, \`proxymock init\` offers to trust its CA in the system store. On Linux, configure certificate trust as described below.
    
3.  3. Generate one real workflow
    
    ```
    ./lab/tests/run_tests.sh --recording
    ```
    
    Run the test driver from the repo root. It drives the requests that become the exported production-style trace.
    
4.  4. Stop the recording, then run with mocks
    
    ```
    cd mock-lab/languages/dotnet
    proxymock mock -- dotnet run
    ```
    
    The mocked run should no longer need live downstream access.
    
5.  5. Replay the same traffic against a change
    
    ```
    cd mock-lab/languages/dotnet
    proxymock replay --test-against http://localhost:8080
    ```
    
    Use replay as the regression check before shipping .NET changes.
    

<a id="tls-trust"></a>

## TLS Trust

On Linux, modern .NET uses OpenSSL and respects `SSL_CERT_FILE`. On macOS, .NET validates certificates with the system keychain and ignores `SSL_CERT_FILE`. proxymock adds its CA to the keychain unless you pass `--no-cert-install`. See the shared [Language Configuration](https://docs.speedscale.com/proxymock/getting-started/language-reference/#tls-trust) page for the exact command and any platform-specific caveats.

<a id="windows-tls-trust"></a>

### Windows TLS trust

.NET on Windows validates certificates with the Windows certificate store and ignores `SSL_CERT_FILE`. `proxymock init` offers to add the proxymock CA to your user's store; confirm the Windows dialog. If you skipped it or run headless, follow the [Windows certificate store](https://docs.speedscale.com/proxymock/getting-started/language-reference/#windows-tls-trust) steps. Then route the client through proxymock.

For `HttpClient` on .NET Core 3.0 or later using its default proxy settings, set `HTTPS_PROXY` in the PowerShell session that launches the HTTPS client. Use the configured proxy address if you changed the default listener.

```powershell
$env:HTTPS_PROXY = "http://127.0.0.1:4140"
```

.NET Framework ignores proxy environment variables, so point it at proxymock through the Windows system proxy or a `defaultProxy` entry in its app.config.
