README 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. WARNING WARNING WARNING!!!
  2. This stuff is experimental, may change radically or be deleted altogether
  3. before OpenSSL 0.9.7 release. You have been warned!
  4. Configuration modules. These are a set of modules which can perform
  5. various configuration functions.
  6. Currently the routines should be called at most once when an application
  7. starts up: that is before it starts any threads.
  8. The routines read a configuration file set up like this:
  9. -----
  10. #default section
  11. openssl_init=init_section
  12. [init_section]
  13. module1=value1
  14. #Second instance of module1
  15. module1.1=valueX
  16. module2=value2
  17. module3=dso_literal
  18. module4=dso_section
  19. [dso_section]
  20. path=/some/path/to/some/dso.so
  21. other_stuff=other_value
  22. ----
  23. When this file is loaded a configuration module with the specified
  24. string (module* in the above example) is looked up and its init
  25. function called as:
  26. int conf_init_func(CONF_IMODULE *md, CONF *cnf);
  27. The function can then take whatever action is appropriate, for example
  28. further lookups based on the value. Multiple instances of the same
  29. config module can be loaded.
  30. When the application closes down the modules are cleaned up by calling
  31. an optional finish function:
  32. void conf_finish_func(CONF_IMODULE *md);
  33. The finish functions are called in reverse order: that is the last module
  34. loaded is the first one cleaned up.
  35. If no module exists with a given name then an attempt is made to load
  36. a DSO with the supplied name. This might mean that "module3" attempts
  37. to load a DSO called libmodule3.so or module3.dll for example. An explicit
  38. DSO name can be given by including a separate section as in the module4 example
  39. above.
  40. The DSO is expected to at least contain an initialization function:
  41. int OPENSSL_init(CONF_IMODULE *md, CONF *cnf);
  42. and may also include a finish function:
  43. void OPENSSL_finish(CONF_IMODULE *md);
  44. Static modules can also be added using,
  45. int CONF_module_add(char *name, dso_mod_init_func *ifunc, dso_mod_finish_func *ffunc);
  46. where "name" is the name in the configuration file this function corresponds to.
  47. A set of builtin modules (currently only an ASN1 non functional test module) can be
  48. added by calling OPENSSL_load_builtin_modules().
  49. The function OPENSSL_config() is intended as a simple configuration function that
  50. any application can call to perform various default configuration tasks. It uses the
  51. file openssl.cnf in the usual locations.