Skip to content

Instantly share code, notes, and snippets.

View juicemia's full-sized avatar

Hugo juicemia

  • Miami
View GitHub Profile
@juicemia
juicemia / sample.cs
Created December 9, 2022 18:38
CA certificate verification
var caCert = X509Certificate2.CreateFromPem(options.CaCertificate!);
clientSettings.CreateHttpMessageHandler = () =>
{
var httpSettings = new SocketsHttpHandler()
{
// This is taken from the default implementation.
KeepAlivePingDelay = clientSettings.ConnectivitySettings.KeepAliveInterval,
KeepAlivePingTimeout = clientSettings.ConnectivitySettings.KeepAliveTimeout,
};
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"time"