Created
November 2, 2016 10:44
-
-
Save starx/4640b11f029af70af601e715955dae61 to your computer and use it in GitHub Desktop.
Generate x509 Certificate using Expect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/bin/expect -c 'spawn openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./apache.key -out ./apache.crt | |
expect -re {Country Name \(2 letter code\) [^:]*:} {send "NP\n"} | |
expect -re {State or Province Name \(full name\) [^:]*:} {send "Bagmati\n"} | |
expect -re {Locality Name \(eg, city\) [^:]*:} {send "Budhanilkantha\n"} | |
expect -re {Organization Name \(eg, company\) [^:]*:} {send "nGen Technologies\n"} | |
expect -re {Organizational Unit Name \(eg, section\) [^:]*:} {send "Software Development\n"} | |
expect -re {Common Name \(e.g. server FQDN or YOUR name\) [^:]*:} {send "mrnepal.com\n"} | |
expect -re {Email Address [^:]*:} {send "[email protected]\n"} | |
expect eof' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment