OpenSSL with unicode paths

I have a client handshake SSL implementation using the following functions: SSL_CTX_load_verify_locations SSL_CTX_use_certificate_chain_file SSL_CTX_use_PrivateKey_file

All functions get char * type for the file name parameter. How can I change it to support file location in Unicode?

Thank!

+3
source share
2 answers

On which platform? OpenSSL under Posix supports UTF-8 paths, but not on other platforms. Most likely, you will have to manually upload the certificate files yourself, using standard input / output functions of OS files that support Unicode paths, and then analyze the raw data and load it into OpenSSL, for example, via PEM_read_bio_X509with sk_X509_NAME_push, PEM_read_bio_PrivateKey/d2i_PrivateKey_biowith SSL_CTX_use_PrivateKey, d2i_X509_bio/PEM_read_bio_X509with SSL_CTX_use_certificate, etc. .

+2
source

, , , . SSL_CTX_load_verify_locations openssl, openssl utf-8 , Windows. BIO_new_file, , utf-8 , _WIN32, CP_UTF8. . openssl ANSI-, utf-8. , openssl utf-8, ANSI- Windows.

0

Source: https://habr.com/ru/post/1735911/


All Articles