Boost のSSL Clientを見ています。コメントに OpenSSL への参照があります (申し訳ありませんが、行番号はありません)。
// The verify callback can be used to check whether the certificate that is
// being presented is valid for the peer. For example, RFC 2818 describes
// the steps involved in doing this for HTTPS. Consult the OpenSSL
// documentation for more details. Note that the callback is called once
// for each certificate in the certificate chain, starting from the root
// certificate authority.
適切な OpenSSL の使用と検証は難しい場合があります。経験から、ライブラリを正しく使用するには、次のことを実行する必要があることを知っています。
- Context オブジェクトで SSLv2、SSLv3、および圧縮を無効にする
- チェーンの構築とチェックのために適切なルート証明書を提供する
- 呼び出し
SSL_get_peer_certificate
て、証明書が非 NULL であることを確認します - 呼び出し
SSL_get_verify_result
て、結果が次のとおりであることを確認します。X509_V_OK
- 名前の照合を実行します (CN または SAN は、要求されたホストと一致する必要があります)
OpenSSL 1.1.0 は名前チェックを提供しますが、現時点では HEAD のみです。OpenSSL 変更ログから:
Integrate hostname, email address and IP address checking with certificate
verification. New verify options supporting checking in opensl utility.
と:
New functions to check a hostname email or IP address against a
certificate. Add options x509 utility to print results of checks against
a certificate.
クライアント コードで Boost が構成またはチェックを実行している場所がわかりません。
Boost は正確に何を構成し、asio
SSL を使用するときにそのライブラリ コンポーネントで何をチェックまたは検証しますか?