Skip to content

Instantly share code, notes, and snippets.

View devtdeng's full-sized avatar

Tao Deng devtdeng

  • Pivotal
  • Paris, France
View GitHub Profile
import java.io.*;
import javax.net.ssl.*;
/*
* This example demostrates how to use a SSLSocket as client to
* send a HTTP request and get response from an HTTPS server.
* It assumes that the client is not behind a firewall
* https://docs.oracle.com/javase/10/security/sample-code-illustrating-secure-socket-connection-client-and-server.htm
*
* Usage:
@devtdeng
devtdeng / verify_certificate.go
Last active April 28, 2022 13:45
Verify a certificate with chain with golang crypto library
package main
import (
"crypto/x509"
"encoding/pem"
"io/ioutil"
"log"
"os"
)