Skip to content

Instantly share code, notes, and snippets.

View yusiwen's full-sized avatar

Siwen Yu yusiwen

View GitHub Profile
@yusiwen
yusiwen / jira-behing-nginx-ssl
Last active March 24, 2020 14:39 — forked from jtbonhomme/jira-behing-nginx-ssl
Atlassian JIRA behind Nginx + SSL #nginx #jira
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@yusiwen
yusiwen / BouncyCastleCertificateGenerator.java
Created May 25, 2021 07:57 — forked from vivekkr12/BouncyCastleCertificateGenerator.java
Generate root X509Certificate, Sign a Certificate from the root certificate by generating a CSR (Certificate Signing Request) and save the certificates to a keystore using BouncyCastle 1.5x
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x509.BasicConstraints;
import org.bouncycastle.asn1.x509.Extension;
import org.bouncycastle.asn1.x509.GeneralName;
import org.bouncycastle.asn1.x509.KeyUsage;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cert.X509v3CertificateBuilder;
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;