Skip to content

Instantly share code, notes, and snippets.

@lihnux
lihnux / client.go
Last active June 26, 2024 00:42 — forked from xjdrew/client.go
golang client certificate verify 客户端证书验证
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
//Decodes Base64
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <stdint.h>
#include <assert.h>
size_t calcDecodeLength(const char* b64input) { //Calculates the length of a decoded string
size_t len = strlen(b64input),
padding = 0;