apt install -y openssl
vim /etc/ssl/openssl.cnf
[ CA_default ] dir = /etc/ssl/CA x509_extensions = v3_req policy = policy_anything
[ req_distinguished_name ] countryName_default = KR #stateOrProvinceName = Some-State 0.organizationName_default = VDI
[ v3_req ] crlDistributionPoints = URI:https://crl.vdi.local/vdi-CA.crl authorityInfoAccess = OCSP;URI:http://ocsp.vdi.local:8080
[ v3_ca ] crlDistributionPoints = URI:https://crl.vdi.local/vdi-CA.crl authorityInfoAccess = OCSP;URI:http://ocsp.vdi.local:8080
[ v3_ocsp ] basicConstraints = CA:FALSE keyUsage = nonRepundiation, digitalSignature, keyEncipherment extendedKeyUsage = OCSPSigning
vim /usr/lib/ssl/misc/CA.pl
my $CATOP = "/etc/ssl/CA";
/usr/lib/ssl/misc/CA.pl -newca 📌 CN=VDI-CA
cp /etc/ssl/CA/cacert.pem /usr/local/share/ca-certificates/ca.crt
update-ca-certificates
mkdir /CERT/; cd /CERT/; cp /etc/ssl/CA/cacert.pem /CERT/vdi-CA.crt
vim /CERT/extlist
crlDistributionPoints = URI:https://crl.vdi.local/vdi-CA.crl authorityInfoAccess = OCSP;URI:http://ocsp.vdi.local:8080 subjectAltName = DNS:*.vdi.local
vim /CERT/cert.sh
#!/bin/bash
read -p "Input the filename: " in openssl req -new -out /CERT/$in.req -newkey rsa:2048 -keyout /CERT/$in.key openssl ca -in /CERT/$in.req -out /CERT/$in.crt -extfile extlist rm -f /CERT/$in.req
exit 0
chmod 700 /CERT/cert.sh
vim /root/.bashrc
alias cert='/CERT/cert.sh'
source /root/.bashrc
cd /CERT/
cert
Input the filename: crl 📌 CN=crl.vdi.local
apt install -y apache2
openssl ca -gencrl -out /var/www/html/vdi-CA.crl
cp /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-available/vdi-crl.conf
vim /etc/apache2/sites-available/vdi-crl.conf
ServerName crl.vdi.local
DocumentRoot /var/www/html
SSLCertificateFile /CERT/crl.crt SSLCertificateKeyFile /CERT/crl.key
SSLCACertificatePath /CERT/ SSLCACertificateFile /CERT/vdi-CA.crt