Skip to content

Instantly share code, notes, and snippets.

View GavinOsborn's full-sized avatar

Gavin Osborn GavinOsborn

  • Melbourne, Australia
View GitHub Profile
@GavinOsborn
GavinOsborn / gist:6893559
Created October 8, 2013 23:26
Did you know that in C# an instance of a Type can access the private members of another instance of the same type?
void Main()
{
var a = new Foo("Secret of A");
var b = new Foo("Secret of B");
a.SomeMethod(b);
}
public class Foo
{
private string _privateMember;
@GavinOsborn
GavinOsborn / local-tls-wsl.sh
Last active November 25, 2025 14:45
dotnet dev-certs on WSL Ubuntu
# PROBLEM: You want to do .NET local development using WSL but you are struggling to get TLS to work using dotnet dev-certs.
#
# This was tested on Windows 10 using an Ubuntu 20.04 WSL distro. Both environments targeted .NET 6.
# I stiched this together from snippets of information found in the following resources:
# - https://code.luasoftware.com/tutorials/linux/upgrade-openssl-on-ubuntu-20/
# - https://github.com/dotnet/aspnetcore/issues/27344
# - https://docs.microsoft.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-6.0&tabs=visual-studio
#
# STEP 0: Check your OpenSSL version
# RUN THIS FROM A TERMINAL ON WSL VM