設定 CloudFront 的 Wildcard SSL (SNI)

不知道為什麼網路上一堆文章寫的超複雜 XD

目前必須使用 CLI 才能上傳 key 與 SSL certificate,所以乖乖的裝上 aws-cli 吧 :p

而通常在買 Wildcard SSL 時會 *.example.com 的時候會簽成 example.com + *.example.com,這時候用 example.com 當名字掛進去:

aws iam upload-server-certificate --server-certificate-name example.com --certificate-body file://server.crt --private-key file://server.key --certificate-chain file://intermediate.crt --path /cloudfront/

一樣可以確認:

aws iam get-server-certificate --server-certificate-name example.com

會改到的幾個部份用粗體標出來了。

上傳完成後就可以到 Web Console 上的 CloudFront 部份設定了。

主要是參考「Building a CDN over SSL with CloudFront and SNI」這篇文章的說明,再加上一些亂試後去翻文件確認的結果 :o

由 RSA Key 產生 CSR 的方法 (OpenSSL)

從「OpenSSL CSR with Alternative Names one-line」這篇看到的方法,一行解決,可以寫到 Makefile 之類的地方處理?

給了兩個範例:

openssl req -new -key endpoint.com.key -sha256 -nodes -subj '/C=US/ST=New York/L=New York/O=End Point/OU=Hosting Team/CN=www.endpoint.com/emailAddress=administrative-not-existent-address@our-awesome-domain.com/subjectAltName=DNS.1=endpoint.com' > www.endpoint.com.csr

以及:

openssl req -new -key endpoint.com.key -sha256 -nodes -subj '/C=US/ST=New York/L=New York/O=End Point/OU=Hosting Team/CN=www.endpoint.com/emailAddress=administrative-not-existent-address@our-awesome-domain.com/subjectAltName=DNS.1=endpoint.com,DNS.2=usually-not-convered-domain.endpoint.com,DNS.3=multiple-domains-crt.endpoint.com' > www.endpoint.com.csr

記錄起來,以後應該還用的到 :p

PostgreSQL 的 command line 工具調整

在「Optimizing Your psql」這篇介紹了 PostgreSQL 的 command line 工具 psql 要怎麼調整讓他變好用。

這篇文章是入門的調整,藉由 $HOME/.psqlrc 裡的幾行設定,就可以讓系統變得好用很多,可以看到最後面給的 .psqlrc 也才八行...

歷史上的爆炸記錄?

在「a brief history of one line fixes」列出了許多經典的問題...

裡面最有印象的還是 2008 年 Debian OpenSSL 問題,也因為這個問題影響太嚴重,後來預設會安裝 openssl-blacklist 這個套件,在連線時檢查是不是有問題的 key...

然後 Android memset() 那個很精彩啊 XDDDDDDDDDDD