Skip to content

wux1an/fake-cert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βš’οΈ fake-cert

This repository is a Go library that generates random TLS certificates 🎊

πŸ… Feature

Generate a random tls certificate with:

  • random serial number
  • random subject information
  • random validity, the year, the month and the day are random
  • random encryption suite (defence ja3)
  • copy certificate information from certain website (defence ja3)

Preview:

🎨 Usage

Create a simple https server:

go get -u github.com/wux1an/fake-useragent
package main

import (
	"crypto/tls"
	"github.com/wux1an/fake-cert"
	"fmt"
	"net/http"
)

func main() {
	http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
		writer.Write([]byte("Your IP Address: " + request.RemoteAddr))
	})

	// 1. create tls certificate
	certs := cert.Random(2048)
	listener, _ := tls.Listen("tcp", "127.0.0.1:2023", &tls.Config{Certificates: []tls.Certificate{certs}})

	// 2. start a http server
	fmt.Println("http served at https://127.0.0.1:2023")
	_ = http.Serve(listener, nil)
}

πŸ”— References