SC Workbook
科目 A-2 · セキュリティ

証明書の SAN とホスト名照合

次のサーバ証明書(抜粋)は,ブラウザが信頼する CA が発行した,有効期間内で失効していない証明書である。ブラウザが RFC 9525 に従ってホスト名を検証するとき,検証に成功する URL はどれか。

Subject: CN = www.example.com
X509v3 extensions:
    X509v3 Subject Alternative Name:
        DNS:example.com, DNS:*.shop.example.com
  1. アhttps://www.example.com/
  2. イhttps://shop.example.com/
  3. ウhttps://pay.shop.example.com/
  4. エhttps://api.pay.shop.example.com/
正解と解説を見る

正解 ウ

この問題の基礎知識

  • サーバ証明書の SAN(Subject Alternative Name)拡張には,証明書の対象とするホスト名を dNSName として複数記載でき,ブラウザはアクセス先のホスト名を SAN と照合する。
  • RFC 9525 では,サービスの識別に Subject の CN を用いてはならず,ホスト名は SAN の dNSName で照合する。
  • 証明書のワイルドカード「*」は左端のちょうど 1 ラベルに一致し,「*.example.net」は「a.example.net」に一致するが,「example.net」や「a.b.example.net」には一致しない。
アhttps://www.example.com/

Subject の CN は www.example.com だが,RFC 9525 は CN をサービスの識別に用いてはならないとしている。SAN には www.example.com も,これに一致するワイルドカードも無いので,検証に失敗する。

イhttps://shop.example.com/

*.shop.example.com のワイルドカードは,左端のちょうど 1 ラベルに一致するものである。shop.example.com には * に対応するラベルが無くラベル数が異なるので一致せず,SAN の example.com とも一致しないので失敗する。

ウhttps://pay.shop.example.com/正解

左端のラベル pay がワイルドカード * に一致し,残りの shop.example.com も各ラベルが一致するので,SAN の *.shop.example.com によって検証に成功する。

エhttps://api.pay.shop.example.com/

証明書のワイルドカードは 1 ラベルにしか一致しないので,*.shop.example.com は api.pay の 2 ラベル分には一致せず,失敗する。DNS のワイルドカードのように複数のラベルに一致すると考えると誤る。

検証用の出典出典照合済み
RFC 9525 Service Identity in TLS / RFC 5280 Internet X.509 PKI Certificate and CRL Profile
照合の根拠(5 件)
  • ア(誤り): ホスト名は SAN の dNSName だけで照合する
    Only check DNS domain names via the subjectAltName extension designed for that purpose: dNSName.
    RFC 9525 · Section 1.3(新しいタブで開きます)
  • ア(誤り): Subject の CN をサービスの識別に用いてはならないので,CN = www.example.com では検証に成功しない
    The Common Name RDN MUST NOT be used to identify a service because it is not strongly typed (it is essentially free-form text) and therefore suffers from ambiguities in interpretation.
    RFC 9525 · Section 4(新しいタブで開きます)
  • ウ(正解)・イ(誤り): ワイルドカードの規則を除き各ラベルが一致する必要があるので,ラベル数が異なる shop.example.com は *.shop.example.com に一致しない
    Each label MUST match in order for the domain names to be considered to match, except as supplemented by the rule about checking wildcard labels in presented identifiers given below.
    RFC 9525 · Section 6.3(新しいタブで開きます)
  • ウ(正解)・エ(誤り): * は 1 ラベル(pay)に一致し,api.pay の 2 ラベルには一致しない
    A wildcard in a presented identifier can only match one label in a reference identifier.
    RFC 9525 · Section 6.3(新しいタブで開きます)
  • エ(誤り): 複数ラベルに一致し得る DNS のワイルドカードとは異なる
    Therefore, the use of wildcard characters as described herein is not to be confused with DNS wildcard matching, where the "*" label always matches at least one whole label and sometimes more;
    RFC 9525 · Section 6.3(新しいタブで開きます)
問題 ID A2-SEC-0213 · AI 作成のオリジナル問題 · 正解と各選択肢の根拠を出典の原文で確認しています。 照合日 2026-11-08

非公式の学習用アプリです(IPA とは関係ありません)。問題はすべて AI が作成したオリジナルで、誤りを含む場合があります。