2
0

gen-test-certs.sh 660 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. mkdir -p tests/tls
  3. openssl genrsa -out tests/tls/ca.key 4096
  4. openssl req \
  5. -x509 -new -nodes -sha256 \
  6. -key tests/tls/ca.key \
  7. -days 3650 \
  8. -subj '/O=Redis Test/CN=Certificate Authority' \
  9. -out tests/tls/ca.crt
  10. openssl genrsa -out tests/tls/redis.key 2048
  11. openssl req \
  12. -new -sha256 \
  13. -key tests/tls/redis.key \
  14. -subj '/O=Redis Test/CN=Server' | \
  15. openssl x509 \
  16. -req -sha256 \
  17. -CA tests/tls/ca.crt \
  18. -CAkey tests/tls/ca.key \
  19. -CAserial tests/tls/ca.txt \
  20. -CAcreateserial \
  21. -days 365 \
  22. -out tests/tls/redis.crt
  23. openssl dhparam -out tests/tls/redis.dh 2048