gtpc1m5h | Transmission Control Protocol/Internet Protocol |
The SSL_CTX_load_verify_locations function loads the
certificates of the certificate authorities (CAs) that are trusted by this
application and that will be used to verify certificates that are received
from remote applications. Certificate revocation lists (CRLs) are also
loaded if any exist.
Format
#include <openssl/ssl.h>
int SSL_CTX_load_verify_locations(SSL_CTX *ctx,
const char *CAfile,
const char *CApath)
- ctx
- A pointer to a token returned on the SSL_CTX_new call or the
SSL_CTX_new_shared call.
- CAfile
- A pointer to the name of the file that contains the certificates of the
trusted CAs and CRLs. The file must be in PEM (base64 encoded)
format. The value of this parameter can be NULL if the value of the
CApath parameter is not NULL. The maximum length is 255
characters.
- CApath
- A pointer to the name of the directory that contains the certificates of
the trusted CAs and CRLs. The files in the directory must be in PEM
(base64 encoded) format. The value of this parameter can be NULL if the
value of the CAfile parameter is not NULL. The maximum
length is 255 characters.
Normal Return
Return code 1 indicates that the function was successful.
Error Return
A return code equal to 0 indicates an error. The following are the
most likely causes of errors:
- The certificate authority (CA) file and the CA path are both NULL.
- If the CA file is not NULL, either the file does not exist or you do not
have permission to read that file.
- If the CA path is not NULL, the path does not exist.
Programming Considerations
- You must issue the SSL_CTX_load_verify_locations function if
your application is going to verify certificates received from remote
applications.
- The values of the CAfile and CApath parameters
cannot both be NULL. You can specify a value of NULL for only one
parameter or set both parameters to values other than NULL.
Examples
For sample SSL applications, go to http://www.ibm.com/tpf/pubs/tpfpubs.htm,
click SSL for the TPF 4.1 System: An Online User's
Guide, and click Examples from the left navigation
bar.
Related Information