ERR_load_BIO_strings

ERR_load_BIO_stringsで、エラー文字列をロードすることで、意味の分からないエラーコードをある程度エラー文字列に変換して出力させる。

OpenSSL API によるセキュア・プログラミング: 第 1 回 API の概要

ERR_load_BIO_strings.cで、

最初にERR_load_BIO_stringsでエラー文字列をロードさせておく。

$ vi ERR_load_BIO_strings.c
$ gcc -o ERR_load_BIO_strings ERR_load_BIO_strings.c -lssl -lcrypto
$ ./ERR_load_BIO_strings 
ctx = 014f96e0
SSL_CTX_load_verify_locations error!
140602612119448:error:02001002:system library:fopen:No such file or directory:bss_file.c:175:fopen('dummyurl','r')
140602612119448:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:182:
140602612119448:error:0B084002:x509 certificate routines:func(132):system lib:by_file.c:258:
$

lib(2)がsystem libraryで、func(1)がfopenで、reason(2)がNo such file or directoryという感じである程度は内容がわかった。

Sample/openssl/ERR_load_BIO_strings/ERR_load_BIO_strings/src/ERR_load_BIO_strings at master · bg1bgst333/Sample · GitHub