Skip to content

Instantly share code, notes, and snippets.

View deskoh's full-sized avatar
👽
iamdeskoh

Desmond Koh deskoh

👽
iamdeskoh
View GitHub Profile
@deskoh
deskoh / webcrypto-examples.md
Created May 9, 2020 14:00 — forked from pedrouid/webcrypto-examples.md
Web Cryptography API Examples
@deskoh
deskoh / self-signed-certificate-with-custom-ca.md
Last active February 24, 2021 09:19 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

TLDR

# Generate CA key and cert (use -nodes to remove pass phrase)
openssl req -x509 -nodes -newkey rsa:2048 -keyout rootCA.key \
  -days 1024 -out rootCA.crt \
  -subj "/C=SG/OU=www.org/O=MyOrg, Inc./CN=My Org Root CA"
# Generate server key and CSR (OpenSSL 1.1.1+)
@deskoh
deskoh / app.js
Last active July 29, 2019 06:18 — forked from marshallswain/app.js
Authenticate on feathers-socketio connection with header
const socketio = require('feathers-socketio')
const authOnSocketConnect = require('./authenticate-on-socket-connect')
// ... Setup your Feathers app code or use the generator then replace the socketio registration with this
// When you register the feathers-socketio plugin, use the utility
app.configure(socketio(function (io) {
// Get Socket.io headers
io.on('connection', function (socket) {
authOnSocketConnect({ app, socket })