OmegaAOL.Bifrost 1.0.0

dotnet add package OmegaAOL.Bifrost --version 1.0.0
                    
NuGet\Install-Package OmegaAOL.Bifrost -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OmegaAOL.Bifrost" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OmegaAOL.Bifrost" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OmegaAOL.Bifrost" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OmegaAOL.Bifrost --version 1.0.0
                    
#r "nuget: OmegaAOL.Bifrost, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OmegaAOL.Bifrost@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OmegaAOL.Bifrost&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=OmegaAOL.Bifrost&version=1.0.0
                    
Install as a Cake Tool

Bifrost

Originally built for Skymu.

Bifrost is a drop,in replacement for native TLS, HttpClient, and ClientWebSocket on legacy systems with outdated TLS stacks or certificate stores, it performs the TLS handshake with Bouncy Castle instead of SslStream/Schannel, so HTTPS and WSS works on machines whose own TLS implementation cannot negotiate modern protocol versions anyway.

The package ID and root namespace are OmegaAOL.Bifrost. it provides:

  • OmegaAOL.Bifrost.Http.BifrostEngine, an HttpMessageHandler you can hand to HttpClient with HTTP/1.1 keep,alive, gzip/deflate decompression, redirects, and per,host connection pooling.
  • OmegaAOL.Bifrost.WebSockets.BifrostWebSocket, an RFC 6455 WebSocket client for ws:// and wss://, with automatic ping/pong handling.
  • TLS 1.3,capable Bouncy Castle TLS with SNI, certificate chain validation, hostname verification, and an embedded CA bundle that dont depend on an OS trust store which may be years out of date.

TLS compatibility

Platform Gap in the native stack What Bifrost provides
Windows 98, ME, 2000, XP, Vista No TLS 1.2 or TLS 1.3 TLS 1.2/1.3 through Bouncy Castle
Windows 7, 8, 8.1, 10 No TLS 1.3 TLS 1.3 through Bouncy Castle
Older macOS and Linux releases Missing required TLS versions or cipher suites The same TLS code path on every supported runtime

Certificate trust is handled by Bifrost itself, an embedded CA bundle are used by default, with options for the system store or a custom PEM bundle so a stale OS certificate store dont block HTTPS/WSS connections.

Install

dotnet add package OmegaAOL.Bifrost --version 1.0.0

or add it to your project file:

<PackageReference Include="OmegaAOL.Bifrost" Version="1.0.0" />

The package targets netstandard2.0, so it works on .NET Framework 4.6.1+, .NET Core 2.0+, and modern .NET, its only dependency is BouncyCastle.Cryptography 2.7.0 which is restored automaticly.

HTTP client

BifrostEngine is an HttpMessageHandler, HttpClient owns and dispose it by default:

using System;
using System.Net.Http;
using System.Threading.Tasks;
using OmegaAOL.Bifrost.Http;

public static class Example
{
    public static async Task<string> GetAsync()
    {
        using (var client = new HttpClient(new BifrostEngine(maxPoolSize: 10)))
        {
            return await client.GetStringAsync("https://example.com/");
        }
    }
}

POST requests works the same way as any other handler:

using (var client = new HttpClient(new BifrostEngine()))
{
    var content = new StringContent("{\"name\":\"bifrost\"}", System.Text.Encoding.UTF8, "application/json");
    HttpResponseMessage response = await client.PostAsync("https://example.com/api", content);
    response.EnsureSuccessStatusCode();
    string body = await response.Content.ReadAsStringAsync();
}

Notes:

  • maxPoolSize (default 10) is the maximum number of idle keep,alive connections retained per host:port. Connections is reused when available and discarded on error.
  • Redirects are followed automatically, up to 10 hops.
  • Response bodies with Content-Encoding: gzip or deflate are decompressed automatically. The AutomaticDecompression property is kept only for API compatibility; changing it has no effect at all, so dont worry about it.
  • Requests are written as HTTP/1.1. Proxies, cookies, authentication challenges, and HTTP/2 are not implemented.

WebSocket client

using System;
using System.Net.WebSockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using OmegaAOL.Bifrost.WebSockets;

public static class Example
{
    public static async Task<string> EchoAsync()
    {
        using (var socket = new BifrostWebSocket())
        {
            socket.Options.SetRequestHeader("Origin", "https://example.com");
            socket.Options.AddSubProtocol("chat");

            await socket.ConnectAsync(new Uri("wss://echo.example.com/ws"), CancellationToken.None);

            byte[] payload = Encoding.UTF8.GetBytes("hello");
            await socket.SendAsync(
                new ArraySegment<byte>(payload),
                WebSocketMessageType.Text,
                endOfMessage: true,
                CancellationToken.None);

            var buffer = new byte[8192];
            WebSocketReceiveResult result = await socket.ReceiveAsync(
                new ArraySegment<byte>(buffer), CancellationToken.None);

            await socket.CloseAsync(
                WebSocketCloseStatus.NormalClosure, "done", CancellationToken.None);

            return Encoding.UTF8.GetString(buffer, 0, result.Count);
        }
    }
}

ReceiveAsync returns fragments as they arrive, keep reading until result.EndOfMessage is true to assemble a full message, incoming ping frames are answered automatically and close frames are reported with WebSocketMessageType.Close. State and SubProtocol reflects the connection; CloseStatus/CloseStatusDescription and Options.KeepAliveInterval are reserved for future use and are not currently populated or applied, RequestHeaders can also be filled directly and AddSubProtocol stores a single requested protocol (the last call wins).

Certificate trust configuration

By default Bifrost validates the server chain against a CA bundle embedded in the assembly, falls back to the platform certificate store if that chain fails, and always checks the certificate validity window and hostname, this happens on every handshake.

Trust behavior can be change with an XML file in the application data folder:

  • Windows: %APPDATA%\OmegaAOL\Bifrost\ratatoskr.xml
  • Other platforms: the equivalent ApplicationData folder (for example ~/.config/OmegaAOL/Bifrost/ratatoskr.xml)
<Bifrost>
  
  <CertificateStore>Embedded</CertificateStore>

  
  <CertPath>C:\certs\cacert.pem</CertPath>

  
  <EnableCNFallback>false</EnableCNFallback>
</Bifrost>

Values for CertificateStore (the OmegaAOL.Bifrost.Tls.CertStore enum) is:

Value Behavior
Embedded Use the bundled CA PEM; fall back to the system chain if validation fails.
System Use the platform X509Chain with online revocation checking.
Custom Use only the PEM file at CertPath; a missing or invalid file fails the handshake.

If the file is absent or malformed, Bifrost falls back to the Embedded behavior, TLS handshakes timeouts after 15 seconds.

Diagnostics

Debug builds emits trace messages through Debug.WriteLine, tagged [BIFROST-TLS], [BIFROST-HTTP], and [BIFROST-WS], attach a TraceListener or use a debugger to see negotiated TLS versions, cipher suites, certificate decisions, and connection reuse.

Building and publishing the package

dotnet pack -c Release -o artifacts
dotnet nuget push artifacts\OmegaAOL.Bifrost.1.0.0.nupkg --api-key <your-api-key> --source https://api.nuget.org/v3/index.json
dotnet nuget push artifacts\OmegaAOL.Bifrost.1.0.0.snupkg --api-key <your-api-key> --source https://api.nuget.org/v3/index.json

Push the symbols package (.snupkg) as well so consumers can step into the library, also update <Version> in Bifrost.csproj and the version in the install snippets when releasing a new version.

License

Licensed under the MIT License, copyright (c) 2026 OmegaAOL and EAZY BLACK.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 11/28/2026

Initial release: BifrostEngine HTTP handler, BifrostWebSocket client, and Bouncy Castle-backed TLS with configurable certificate trust.