Skip to content

Instantly share code, notes, and snippets.

@alexrudd
alexrudd / README.md
Last active November 17, 2023 07:44
OCSP Request in Go

OCSP Request in Go

This came out of debugging the error net/http: TLS handshake timeout which seemed to only be happening for certain endpoints. The thing that these endpoints all had in common was that they used Let's Encrypt as their CA. Some googling lead me to think it might have something to do with OCSP, so I wrote a small application that could make an OCSP request for a specified certificate.

The issue ended up being that the server experience the TLS handshake timeout had port 80 blocked. Port 80 was required to make the OCSP HTTP request to check that the certificate wasn't revoked.

go run ocsp.go ./cert.cer
@ogazitt
ogazitt / auth.go
Created April 14, 2020 05:53
Auth0 PKCE flow for a CLI built in golang
package auth
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
@shaneutt
shaneutt / LICENSE
Last active May 14, 2024 15:02
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit