X509_get_default_cert_file.pod 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. =pod
  2. =head1 NAME
  3. X509_get_default_cert_file, X509_get_default_cert_file_env,
  4. X509_get_default_cert_path_env,
  5. X509_get_default_cert_dir, X509_get_default_cert_dir_env,
  6. X509_get_default_cert_uri, X509_get_default_cert_uri_env -
  7. retrieve default locations for trusted CA certificates
  8. =head1 SYNOPSIS
  9. #include <openssl/x509.h>
  10. const char *X509_get_default_cert_file(void);
  11. const char *X509_get_default_cert_dir(void);
  12. const char *X509_get_default_cert_uri(void);
  13. const char *X509_get_default_cert_file_env(void);
  14. const char *X509_get_default_cert_path_env(void);
  15. const char *X509_get_default_cert_dir_env(void);
  16. const char *X509_get_default_cert_uri_env(void);
  17. =head1 DESCRIPTION
  18. The X509_get_default_cert_file() function returns the default path
  19. to a file containing trusted CA certificates. OpenSSL will use this as
  20. the default path when it is asked to load trusted CA certificates
  21. from a file and no other path is specified. If the file exists, CA certificates
  22. are loaded from the file.
  23. The X509_get_default_cert_dir() function returns a default delimeter-separated
  24. list of paths to a directories containing trusted CA certificates named in the
  25. hashed format. OpenSSL will use this as the default list of paths when it is
  26. asked to load trusted CA certificates from a directory and no other path is
  27. specified. If a given directory in the list exists, OpenSSL attempts to lookup
  28. CA certificates in this directory by calculating a filename based on a hash of
  29. the certificate's subject name.
  30. The X509_get_default_cert_uri() function returns the default URI for a
  31. certificate store accessed programmatically via an OpenSSL provider. If there is
  32. no default store applicable to the system for which OpenSSL was compiled, this
  33. returns an empty string.
  34. X509_get_default_cert_file_env() and X509_get_default_cert_uri_env() return
  35. environment variable names which are recommended to specify nondefault values to
  36. be used instead of the values returned by X509_get_default_cert_file() and
  37. X509_get_default_cert_uri() respectively. The values returned by the latter
  38. functions are not affected by these environment variables; you must check for
  39. these environment variables yourself, using these functions to retrieve the
  40. correct environment variable names. If an environment variable is not set, the
  41. value returned by the corresponding function above should be used.
  42. X509_get_default_cert_path_env() returns the environment variable name which is
  43. recommended to specify a nondefault value to be used instead of the value
  44. returned by X509_get_default_cert_dir(). This environment variable supercedes
  45. the deprecated environment variable whose name is returned by
  46. X509_get_default_cert_dir_env(). This environment variable was deprecated as its
  47. contents can be interpreted ambiguously; see NOTES.
  48. By default, OpenSSL uses the path list specified in the environment variable
  49. whose name is returned by X509_get_default_cert_path_env() if it is set;
  50. otherwise, it uses the path list specified in the environment variable whose
  51. name is returned by X509_get_default_cert_dir_env() if it is set; otherwise, it
  52. uses the value returned by X509_get_default_cert_dir()).
  53. =head1 NOTES
  54. X509_get_default_cert_uri(), X509_get_default_cert_uri_env() and
  55. X509_get_default_cert_path_env() were introduced in OpenSSL 3.1. Prior to this
  56. release, store URIs were expressed via the environment variable returned by
  57. X509_get_default_cert_dir_env(); this environment variable could be used to
  58. specify either a list of directories or a store URI. This creates an ambiguity
  59. in which the environment variable returned by X509_get_default_cert_dir_env() is
  60. interpreted both as a list of directories and as a store URI.
  61. This usage and the environment variable returned by
  62. X509_get_default_cert_dir_env() are now deprecated; to specify a store URI, use
  63. the environment variable returned by X509_get_default_cert_uri_env(), and to
  64. specify a list of directories, use the environment variable returned by
  65. X509_get_default_cert_path_env().
  66. =head1 RETURN VALUES
  67. These functions return pointers to constant strings with static storage
  68. duration.
  69. =head1 SEE ALSO
  70. L<X509_LOOKUP(3)>,
  71. L<SSL_CTX_set_default_verify_file(3)>,
  72. L<SSL_CTX_set_default_verify_dir(3)>,
  73. L<SSL_CTX_set_default_verify_store(3)>,
  74. L<SSL_CTX_load_verify_file(3)>,
  75. L<SSL_CTX_load_verify_dir(3)>,
  76. L<SSL_CTX_load_verify_store(3)>,
  77. L<SSL_CTX_load_verify_locations(3)>
  78. =head1 HISTORY
  79. X509_get_default_cert_uri(), X509_get_default_cert_path_env() and
  80. X509_get_default_cert_uri_env() were introduced in OpenSSL 3.1.
  81. =head1 COPYRIGHT
  82. Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
  83. Licensed under the Apache License 2.0 (the "License"). You may not use
  84. this file except in compliance with the License. You can obtain a copy
  85. in the file LICENSE in the source distribution or at
  86. L<https://www.openssl.org/source/license.html>.
  87. =cut