mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
X509_NAME_get_text_by_NID was deprecated in OpenSSL 4.0.0, and could be removed in a future version of OpenSSL. The replacement APIs are available in all versions of OpenSSL and LibreSSL that we support so we can easily change to make the code future proof. The reason for the deprecation is that X509_NAME_get_text_by_NID can only grab the first entry in a list, and doesn't handle multibyte strings well. The fix is to get the index of the name entry with X509_NAME_get_index_by_NID and use X509_NAME_get_entry to extract the data. Author: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Tristan Partin <tristan@partin.io> Reviewed-by: Andreas Karlsson <andreas@proxel.se> Reviewed-by: Yilin Zhang <jiezhilove@126.com> Discussion: https://postgr.es/m/68B9881D-DAA8-467D-A251-C96E98E57BA0@yesql.se