generate.sh
12345678910111213141516171819202122232425262728293031323334353637383940
#!/bin/bash -xKEY_SIZE=4096DAYS=3650# CAif [ ! -f ca.crt ]; then openssl genrsa $KEY_SIZE > ca.key openssl req -new -x509 -nodes -days $DAYS \ -subj /C=PL/ST=State/L=City/O=Organization/OU=Developer/CN=my.domain.com \ -key ca.key \ -out ca.crtfi# crtif [ ! -f server.crt ]; then openssl req -newkey rsa:$KEY_SIZE -nodes -days $DAYS \ -subj /C=PL/ST=State/L=City/O=Organization/OU=Developer/CN=my.domain.com \ -keyout server.key \ -out server.req openssl x509 -req -days $DAYS -set_serial 01 \ -in server.req \ -out server.crt \ -CA ca.crt \ -CAkey ca.keyfi# Verifyopenssl verify \ -CAfile ca.crt \ ca.crt \ server.crt