Last active
August 29, 2015 14:02
-
-
Save t-cyrill/1a1bd2a85ab597189525 to your computer and use it in GitHub Desktop.
SSL csr auto-generate scripts.
This file contains 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 -f | |
set timeout 5 | |
spawn openssl genrsa -out server.key -aes128 2048 | |
expect "Enter pass phrase" | |
send "pass phrase\n" | |
expect "Verifying - Enter pass phrase" | |
send "pass phrase\n" | |
interact | |
spawn openssl req -new -key server.key -out server.csr | |
expect "Enter pass phrase" | |
send "pass phrase\n" | |
expect "Country Name" | |
send "JP\n" | |
expect "State or Province Name " | |
send "Tokyo\n" | |
expect "Locality Name" | |
send "Tokyo\n" | |
expect "Organization Name" | |
send "foo\n" | |
expect "Organizational Unit Name" | |
send "bar\n" | |
expect "Common Name " | |
send "localhost\n" | |
expect "Email Address" | |
send "\n" | |
expect "A challenge password " | |
send "\n" | |
expect "An optional company name " | |
send "\n" | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment