
1: =pod 2: 3: =head1 NAME 4: 5: SSL_load_client_CA_file - load certificate names from file 6: 7: =head1 SYNOPSIS 8: 9: #include <openssl/ssl.h> 10: 11: STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); 12: 13: =head1 DESCRIPTION 14: 15: SSL_load_client_CA_file() reads certificates from B<file> and returns 16: a STACK_OF(X509_NAME) with the subject names found. 17: 18: =head1 NOTES 19: 20: SSL_load_client_CA_file() reads a file of PEM formatted certificates and 21: extracts the X509_NAMES of the certificates found. While the name suggests 22: the specific usage as support function for 23: L<SSL_CTX_set_client_CA_list(3)|SSL_CTX_set_client_CA_list(3)>, 24: it is not limited to CA certificates. 25: 26: =head1 EXAMPLES 27: 28: Load names of CAs from file and use it as a client CA list: 29: 30: SSL_CTX *ctx; 31: STACK_OF(X509_NAME) *cert_names; 32: 33: ... 34: cert_names = SSL_load_client_CA_file("/path/to/CAfile.pem"); 35: if (cert_names != NULL) 36: SSL_CTX_set_client_CA_list(ctx, cert_names); 37: else 38: error_handling(); 39: ... 40: 41: =head1 RETURN VALUES 42: 43: The following return values can occur: 44: 45: =over 4 46: 47: =item NULL 48: 49: The operation failed, check out the error stack for the reason. 50: 51: =item Pointer to STACK_OF(X509_NAME) 52: 53: Pointer to the subject names of the successfully read certificates. 54: 55: =back 56: 57: =head1 SEE ALSO 58: 59: L<ssl(3)|ssl(3)>, 60: L<SSL_CTX_set_client_CA_list(3)|SSL_CTX_set_client_CA_list(3)> 61: 62: =cut