Skip to content

Instantly share code, notes, and snippets.

View dingzhanjun's full-sized avatar

John Ding dingzhanjun

View GitHub Profile
@dingzhanjun
dingzhanjun / ssl-config
Created March 12, 2020 14:29 — forked from ivanleoncz/ssl-config
Generates self-signed SSL certificates.
[ req ]
default_bits = 2048
distinguished_name = req_distinguished_name
attributes = req_attributes
prompt = no
[ req_distinguished_name ]
C = MX
ST = VE
L = XL

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@dingzhanjun
dingzhanjun / mkcert.sh
Created March 12, 2020 03:03 — forked from rdj/mkcert.sh
Using OpenSSL to create an iOS-compatible self-signed certificate with subjectAltName extension for use with NSURLConnection without overriding willSendRequestForAuthenticationChallenge
#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
ORGNAME=mytestorg
HOSTNAME=$(hostname -s)
KEY_LENGTH=4096
DIGEST=sha512
DAYS_VALID=9999
@dingzhanjun
dingzhanjun / PaginationComponent.js
Created May 17, 2019 17:56 — forked from TimNZ/PaginationComponent.js
Custom PaginationComponent for React Table when it is not practical to know total # of pages
/**
* Override React Table pagination component to be able to control Previous/Next
*/
import React, { Component } from 'react'
import classnames from 'classnames'
const defaultButton = props => (
<button type="button" {...props} className="-btn">
{props.children}