さくら VPS で無料 SSL 証明書 StartSSL を使う (一年目の更新)

ちょうど昨年の今頃、さくら VPS で無料 SSL 証明書 StartSSL を使う という記事を書きましたが、それから一年ほどが経過して証明書の更新の時期になりました。StartCom より「クライアント証明書」(client certificate) と「サーバー証明書」(server certificate) それぞれの更新手続きを通知するメールが届いていました。2通のメールは内容が似ているのですが、それぞれ別に更新を行う必要があるので注意が必要です。

大まかな手順は以下の通りです。

【手順】
1. クライアント証明書の更新
 1.1 メールアドレス認証
 1.2 ドメイン認証
 1.3 証明書の発行
2. サーバー証明書の更新
 2.1 秘密鍵の作成 (or CSR の送付)
 2.2 証明書の発行

多少面倒な手順なので、来年また忘れないようにここにメモを残しておこうと思います。なお、以下の作業ではブラウザは Debian の Iceweasel を使用しています。

1. クライアント証明書の更新

昨年作成したクライアント証明書がインストールされたブラウザで ここ にアクセスし、”Authenticate” をクリックします。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_01.png

個人証明書の要求を求められるので、確認して “OK” をクリックします。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_021.png

1.1 メールアドレス認証

まず、メールアドレスの認証を行います。

コントロールパネルの “Validation Wizard” をクリックします。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_03.png

“Email Address Validation” で “Continue” をクリック。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_04.png

昨年登録したメールアドレスを記入して “Continue” をクリックすると、そのアドレスに “Valification Code” が届くので、それをコピー&ペースト。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_05.png

“Validation Success” と出ると成功です。メールアドレスの認証はこの時点から30日のみとなります。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_06.png

1.2 ドメイン認証

次にドメイン認証を行います。

先ほど同様、コントロールパネルの “Validation Wizard” をクリックします。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_03.png

“Domain Name Validation” を選択して “Continue”。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_07.png

ドメインを入力し、”Continue”。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_08.png

認証コードを受け取るメールアドレスを選択します。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_09.png

メールに届いた “Verification Code” を入力して “Continue”。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_10.png

“Validation Success” と出ると成功です。ドメイン認証もこの時点から30日のみ有効です。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_11.png

1.3 証明書の発行

最後にクライアント証明書の発行です。今回は “Cerifications Wizard” に進みます。 “Certificate Target” は “S/MIME and Authentication Certificate ” を選択して “Continue” をクリック。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_12.png

“High Grade” (高強度の暗号化) を選択して “Continue”。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_13.png

“Email” に上で認証したメールアドレスが記載されていることを確認しておきます。私は “Secure Hash Algorithm” は “SHA2” に変更しました (SHA2 は SHA1 より強固)。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_14.png

ブラウザに自動的にインストールされます。Iceweasel では以下のアラートが表示されました。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_15.png

以上でクライアント証明書のインストールが完了しました。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_16.png

念のため、ファイル (.p12) に証明書のバックアップを取っておきます。Iceweasel では “Preferences” “Advanced” “Encryption” “View Certificates” “Your Certificates” と進むと証明書が見えます (Firefox では「ツール」「オプション」「詳細」「暗号化」「証明書を表示」「あなたの証明書」)。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_17.png

2. サーバー証明書の更新

さて次に、サーバ証明書の作成に移ります。

再び “Cerifications Wizard” に進み、 “Certificate Target” を “Web Server SSL/TLS Certificate” に変更して “Continue” をクリックします。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_18.png

2.1 秘密鍵の作成 (or CSR の送付)

自分のプライベートキーを作成して、それを StartSSL に署名してもらう場合は、ここでは “Skip” をクリックします。私は StartSSL で証明書を作ってもらうことにしました。

適当な “Key Password” を用意し、 “Keysize” には “4096 (High)”、 “Hash Algorithm” には “SHA2” を選択しました。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_19.png

自分のサーバーで CSR を生成した場合はスキップしてくれと再度確認されますが、ここは “OK” で続行します。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_20.png

Private Key が表示されますので適当な名前 (server.key) で保存しておきます。

2.2 証明書の発行

これをドメインに紐付けします。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_21.png

次にサブドメインを入力します。サブドメインを使わない場合でも証明書には含まれるようですので、私はひとまず “www” を指定しました。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_22.png

再度確認。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_23.png

作成されたサーバー証明書が表示されますので、コピーして server.crt など適当な名前で保存します。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_24.png

“Finish” をクリックして終了します。

あとはサーバーで、この証明書 (server.crt) を古いものと置き換え、Apache をリスタートして接続を確認します。

# /etc/init.d/apache2 restart

サーバの起動時に毎度パスフレーズを入力しなければなりませんので、秘密鍵からこのパスフレーズを削除したい場合には、

# cd /etc/ssl/private
# openssl rsa -in server.key -out server.key
Enter pass phrase for server.key: xxxxxxxxxx
writing RSA key

を実行しておきます (パスは適宜読み替えて下さい)。

ブラウザでアクセスして有効期間が更新されていることを確認します。以下は Chromium の “Certificate Information” の “General” を見ています。

https://ryogan.org/blog/wp-content/uploads/2013/05/wpid-startssl_25.png

コメントを残す

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください