⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssl_ctx_load_verify_locations.pod

📁 开源的ssl算法openssl,版本0.9.8H
💻 POD
字号:
=pod=head1 NAMESSL_CTX_load_verify_locations - set default locations for trusted CAcertificates=head1 SYNOPSIS #include <openssl/ssl.h> int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,                                   const char *CApath);=head1 DESCRIPTIONSSL_CTX_load_verify_locations() specifies the locations for B<ctx>, atwhich CA certificates for verification purposes are located. The certificatesavailable via B<CAfile> and B<CApath> are trusted.=head1 NOTESIf B<CAfile> is not NULL, it points to a file of CA certificates in PEMformat. The file can contain several CA certificates identified by -----BEGIN CERTIFICATE----- ... (CA certificate in base64 encoding) ... -----END CERTIFICATE-----sequences. Before, between, and after the certificates text is allowedwhich can be used e.g. for descriptions of the certificates.The B<CAfile> is processed on execution of the SSL_CTX_load_verify_locations()function.If B<CApath> is not NULL, it points to a directory containing CA certificatesin PEM format. The files each contain one CA certificate. The files arelooked up by the CA subject name hash value, which must hence be available.If more than one CA certificate with the same name hash value exist, theextension must be different (e.g. 9d66eef0.0, 9d66eef0.1 etc). The searchis performed in the ordering of the extension number, regardless of otherproperties of the certificates.Use the B<c_rehash> utility to create the necessary links.The certificates in B<CApath> are only looked up when required, e.g. whenbuilding the certificate chain or when actually performing the verificationof a peer certificate.When looking up CA certificates, the OpenSSL library will first search thecertificates in B<CAfile>, then those in B<CApath>. Certificate matchingis done based on the subject name, the key identifier (if present), and theserial number as taken from the certificate to be verified. If these datado not match, the next certificate will be tried. If a first certificatematching the parameters is found, the verification process will be performed;no other certificates for the same parameters will be searched in case offailure.In server mode, when requesting a client certificate, the server must sendthe list of CAs of which it will accept client certificates. This listis not influenced by the contents of B<CAfile> or B<CApath> and mustexplicitly be set using theL<SSL_CTX_set_client_CA_list(3)|SSL_CTX_set_client_CA_list(3)>family of functions.When building its own certificate chain, an OpenSSL client/server willtry to fill in missing certificates from B<CAfile>/B<CApath>, if thecertificate chain was not explicitly specified (seeL<SSL_CTX_add_extra_chain_cert(3)|SSL_CTX_add_extra_chain_cert(3)>,L<SSL_CTX_use_certificate(3)|SSL_CTX_use_certificate(3)>.=head1 WARNINGSIf several CA certificates matching the name, key identifier, and serialnumber condition are available, only the first one will be examined. Thismay lead to unexpected results if the same CA certificate is availablewith different expiration dates. If a "certificate expired" verificationerror occurs, no other certificate will be searched. Make sure to nothave expired certificates mixed with valid ones.=head1 EXAMPLESGenerate a CA certificate file with descriptive text from the CA certificatesca1.pem ca2.pem ca3.pem: #!/bin/sh rm CAfile.pem for i in ca1.pem ca2.pem ca3.pem ; do   openssl x509 -in $i -text >> CAfile.pem donePrepare the directory /some/where/certs containing several CA certificatesfor use as B<CApath>: cd /some/where/certs c_rehash .=head1 RETURN VALUESThe following return values can occur:=over 4=item 0The operation failed because B<CAfile> and B<CApath> are NULL or theprocessing at one of the locations specified failed. Check the errorstack to find out the reason.=item 1The operation succeeded.=back=head1 SEE ALSOL<ssl(3)|ssl(3)>,L<SSL_CTX_set_client_CA_list(3)|SSL_CTX_set_client_CA_list(3)>,L<SSL_get_client_CA_list(3)|SSL_get_client_CA_list(3)>,L<SSL_CTX_use_certificate(3)|SSL_CTX_use_certificate(3)>,L<SSL_CTX_add_extra_chain_cert(3)|SSL_CTX_add_extra_chain_cert(3)>,L<SSL_CTX_set_cert_store(3)|SSL_CTX_set_cert_store(3)>=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -