[精讚] [會員登入]
791

使用expect及 openssl 產生SSL 憑證簽署要求

每年都要製做tls 憑證 二十幾張, 此語法利用expect 產生私錀及憑證請求檔 #!/usr/bin/expect

分享此文連結 //n.sfs.tw/16403

分享連結 使用expect及 openssl 產生SSL 憑證簽署要求@igogo
(文章歡迎轉載,務必尊重版權註明連結來源)
最後編修
2024-04-23 15:28:10 By igogo
 

 

每年都要製做tls 憑證 二十幾張, 

此語法利用expect

產生私錀及憑證請求檔

 



#!/usr/bin/expect


#syntax go.expect 13.key 13csr.txt

set key [lindex $argv 0];
set csr [lindex $argv 1];

set passwd PASSWORD

set timeout -1

spawn openssl genrsa -des3 -out "${key}" 2048

expect "Enter PEM pass phrase:"
send "$passwd\r"

expect "Verifying - Enter PEM pass phrase:"
send "$passwd\r"

interact
set timeout 1000

spawn openssl req -new -key "${key}" -out "${csr}"  

expect "Enter pass phrase for ${key}:"
send "$passwd\r"

#expect "Country Name (2 letter code) [AU]:"
expect "Country Name *:"
send "TW\r"

#expect "State or Province Name (full name) [Some-State]:"
expect "State or Province Name *:"
send "\r"

expect "Locality Name *:"
send "臺中市\r"

expect "Organization Name *:"
send "市政府\r"

expect "Organizational Unit Name *:"
send "教育局\r"

expect "Common Name *:"
send "web.tc.edu.tw\r"

expect "Email Address *:"
send "igogo@tc.edu.tw\r"

expect "A challenge password *:"
send "\r"

expect "An optional company name *:"
send "\r"

interact

 

END

你可能感興趣的文章

臺中市雲端校務系統與Windows AD帳號整合(7) 設定校端更改密碼程式及執行

mongo備份指令 mongodump --host localhost --port 27017 --username root --db

使用expect及 openssl 產生SSL 憑證簽署要求 每年都要製做tls 憑證 二十幾張, 此語法利用expect 產生私錀及憑證請求檔 #!/usr/bin/expect

[web] 自訂模組-打字機與跑馬燈效果 自訂模組-打字機效果

tc web 問與答 Q. 填報網址 A. https://tiny.cc/tc-web Q. 出現了以下畫面, 怎麼辦 A. 建議瀏覽器開無

centos 7 移机出現 dracut-initqueue timeout centos 7 移机出現 dracut-initqueue timeout 處理

隨機好文

java.time 時間 instant java.time

windows ad 如何得知 dn 值 如何得知 windows ad 上的使用者dn 值 https://support.symantec.com/en_US

Arrays.asList 後想再add出現 UnsupportedOperationException 這個問題真是搞死我了 List<String> fruits = Arrays.asList("a

ubuntu ufw ufw 簡易筆記 原則禁止,例外開放 ufw default deny 啟動ufw sudo ufw enable 關掉

Spring Boot Maven wrappers maven, mvnw, build command