Table of Contents

Use a client certificate

Fluxzy support mutual TLS authentication by specifying a client certificate. The certificate can be load either from a PKCS12 file or from the default store.

using Fluxzy;
using Fluxzy.Certificates;
using Fluxzy.Rules.Actions;
using Fluxzy.Rules.Filters.RequestFilters;

var fluxzySetting = FluxzySetting.CreateDefault();

var certificate = Certificate.LoadFromPkcs12("clientCertificiate.p12", "password");

fluxzySetting.AddAlterationRules(
    new SetClientCertificateAction(certificate),
    new AbsoluteUriFilter("https://customapi.com/animals/cats"));

// Create a new proxy instance 
await using var proxy = new Proxy(fluxzySetting);

Console.WriteLine("Press any key to exit");
Console.ReadKey();

Certificate can be loaded from a PKCS12 file or from the default store (Certificate.LoadFromUserStoreByThumbprint)