Skip to content

Instantly share code, notes, and snippets.

[default_conf]
ssl_conf = ssl_sect
[ssl_sect]
system_default = system_default_sect
[system_default_sect]
CipherString = DEFAULT@SECLEVEL=2
@rzikm
rzikm / Directory.Build.props
Last active January 8, 2024 18:47
OCSPStaple
<Project>
<PropertyGroup>
<SkipConfigureTrimming>true</SkipConfigureTrimming>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode>
<TrimmerRemoveSymbols>false</TrimmerRemoveSymbols>
<SelfContained>true</SelfContained>
<!-- <TreatWarningsAsErrors>true</TreatWarningsAsErrors> -->
<!-- Enable NuGet static graph evaluation to optimize incremental restore -->
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
@rzikm
rzikm / Run-HttpClientBenchmark.ps1
Created November 10, 2023 10:06
Run-HttpClientBenchmark.ps1
function Run-HttpClientBenchmark {
[CmdletBinding()]
param(
# Target framework to use
[Parameter()]
[ValidateSet('net8.0', 'net9.0')]
[string] $Framework = 'net9.0',
# Profile to use
[Parameter(Mandatory)]
@rzikm
rzikm / proposal.md
Last active November 6, 2023 14:33
QUIC Additional Options Proposal

Background and motivation

msquic has a lot of connection options and S.N.Q exposes just a few

List of msquic settings - https://github.com/microsoft/msquic/blob/main/docs/Settings.md

Settings I think should be added:

  • Disconnect Timeout - Importance discovered as part of dotnet/runtime#71927. People may want to be more or less aggressive with closing unresponsive streams
  • ncl: we decided against exposing, as this is too MsQuic specific, see discussion in
@rzikm
rzikm / CriticalSectionGuard.cs
Last active March 21, 2024 12:15
Useful C# Snippets
using System.Diagnostics;
using System.Runtime.CompilerServices;
internal sealed class CriticalSectionGuard
{
private int _state;
private StackTrace? _stackTrace;
public void Enter()
{
@rzikm
rzikm / proposal.md
Last active October 4, 2023 16:38
[API Proposal] QuicConnection TLS details

Background and motivation

ASP.NET Core has an ITlsHandshakeFeature type that a dev can use to get information about the TLS connection. We want to support it for HTTP/3: today HTTP/3 only runs on TLS 1.3, but it'll eventually also run on whatever comes after TLS 1.3 and there needs to be a way for people to get that information.

We (asp.net core team) think that this has been discussed and brought up before but I couldn't find an issue in runtime for exposing this information. Tracking in asp.net core: dotnet/aspnetcore#35039. This doesn't block HTTP/3 for us in .NET 7 but will eventually need to be done.

API Proposal (edited by @rzikm)

The proposed API copies that of SslStream.

@rzikm
rzikm / mde_sensor.bpf.c
Last active November 21, 2022 14:15
KRSI - prevent access to "xyz.log"
/*
* MDE Sensor BPF Kernel Program
* @achinbha
*/
#include <vmlinux.h>
//#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
@rzikm
rzikm / api-design.md
Last active November 7, 2023 16:50
QUIC Datagram API

Background and Motivation

RFC 9221 defines an optional extesion to QUIC which allows unreliable sending of arbitrary user data.

The QUIC transport protocol (RFC 9000) provides a secure, multiplexed connection for transmitting reliable streams of application data. QUIC uses various frame types to transmit data within packets, and each frame type defines whether the data it contains will be retransmitted on packet loss. [...] >