A local copy of OpenSSL from GitHub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1788 lines
60 KiB

Revise some renamings of NOTES and README files Some of the notes and readme files have been converted to markdown format recently and renamed during this process. While adding the .md extension was a natural step, switching to mixed cases was not a change to the better, it gives them a ragged appearance: NOTES.ANDROID => NOTES-Android.md NOTES.DJGPP => NOTES-DJGPP.md NOTES.PERL => NOTES-Perl.md NOTES.UNIX => NOTES-Unix.md NOTES.VMS => NOTES-VMS.md NOTES.VALGRIND => NOTES-Valgrind.md NOTES.WIN => NOTES-Windows.txt README.ENGINE => README-Engine.md README.FIPS => README-FIPS.md Moreover, the NOTES-Windows.txt file is the only file which has been converted to markdown but has received a .txt file extension. This doesn't make sense, because the OpenSSL users on Windows will need to read the other markdown documents as well. Since they are developers, we can trust them to be able to associate their favorite editor with the .md extension. In fact, having a comment at the beginning of the file saying that it is in markdown format but we didn't dare to add the correct extension in order not to overwhelm our Windows users can be interpreted either as unintentionally funny or disrespectful ;-) This commit suggests the following more consistent renaming: NOTES.ANDROID => NOTES-ANDROID.md NOTES.DJGPP => NOTES-DJGPP.md NOTES.PERL => NOTES-PERL.md NOTES.UNIX => NOTES-UNIX.md NOTES.VMS => NOTES-VMS.md NOTES.VALGRIND => NOTES-VALGRIND.md NOTES.WIN => NOTES-WINDOWS.md README.ENGINE => README-ENGINES.md README.FIPS => README-FIPS.md (note the plural in README-ENGINES, anticipating a README-PROVIDERS) Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14042)
1 year ago
Revise some renamings of NOTES and README files Some of the notes and readme files have been converted to markdown format recently and renamed during this process. While adding the .md extension was a natural step, switching to mixed cases was not a change to the better, it gives them a ragged appearance: NOTES.ANDROID => NOTES-Android.md NOTES.DJGPP => NOTES-DJGPP.md NOTES.PERL => NOTES-Perl.md NOTES.UNIX => NOTES-Unix.md NOTES.VMS => NOTES-VMS.md NOTES.VALGRIND => NOTES-Valgrind.md NOTES.WIN => NOTES-Windows.txt README.ENGINE => README-Engine.md README.FIPS => README-FIPS.md Moreover, the NOTES-Windows.txt file is the only file which has been converted to markdown but has received a .txt file extension. This doesn't make sense, because the OpenSSL users on Windows will need to read the other markdown documents as well. Since they are developers, we can trust them to be able to associate their favorite editor with the .md extension. In fact, having a comment at the beginning of the file saying that it is in markdown format but we didn't dare to add the correct extension in order not to overwhelm our Windows users can be interpreted either as unintentionally funny or disrespectful ;-) This commit suggests the following more consistent renaming: NOTES.ANDROID => NOTES-ANDROID.md NOTES.DJGPP => NOTES-DJGPP.md NOTES.PERL => NOTES-PERL.md NOTES.UNIX => NOTES-UNIX.md NOTES.VMS => NOTES-VMS.md NOTES.VALGRIND => NOTES-VALGRIND.md NOTES.WIN => NOTES-WINDOWS.md README.ENGINE => README-ENGINES.md README.FIPS => README-FIPS.md (note the plural in README-ENGINES, anticipating a README-PROVIDERS) Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14042)
1 year ago
  1. Build and Install
  2. =================
  3. This document describes installation on all supported operating
  4. systems (the Unix/Linux family, including macOS), OpenVMS,
  5. and Windows).
  6. Table of Contents
  7. =================
  8. - [Prerequisites](#prerequisites)
  9. - [Notational Conventions](#notational-conventions)
  10. - [Quick Installation Guide](#quick-installation-guide)
  11. - [Building OpenSSL](#building-openssl)
  12. - [Installing OpenSSL](#installing-openssl)
  13. - [Configuration Options](#configuration-options)
  14. - [API Level](#api-level)
  15. - [Cross Compile Prefix](#cross-compile-prefix)
  16. - [Build Type](#build-type)
  17. - [Directories](#directories)
  18. - [Compiler Warnings](#compiler-warnings)
  19. - [ZLib Flags](#zlib-flags)
  20. - [Seeding the Random Generator](#seeding-the-random-generator)
  21. - [Setting the FIPS HMAC key](#setting-the-FIPS-HMAC-key)
  22. - [Enable and Disable Features](#enable-and-disable-features)
  23. - [Displaying configuration data](#displaying-configuration-data)
  24. - [Installation Steps in Detail](#installation-steps-in-detail)
  25. - [Configure](#configure-openssl)
  26. - [Build](#build-openssl)
  27. - [Test](#test-openssl)
  28. - [Install](#install-openssl)
  29. - [Advanced Build Options](#advanced-build-options)
  30. - [Environment Variables](#environment-variables)
  31. - [Makefile Targets](#makefile-targets)
  32. - [Running Selected Tests](#running-selected-tests)
  33. - [Troubleshooting](#troubleshooting)
  34. - [Configuration Problems](#configuration-problems)
  35. - [Build Failures](#build-failures)
  36. - [Test Failures](#test-failures)
  37. - [Notes](#notes)
  38. - [Notes on multi-threading](#notes-on-multi-threading)
  39. - [Notes on shared libraries](#notes-on-shared-libraries)
  40. - [Notes on random number generation](#notes-on-random-number-generation)
  41. - [Notes on assembler modules compilation](#notes-on-assembler-modules-compilation)
  42. Prerequisites
  43. =============
  44. To install OpenSSL, you will need:
  45. * A "make" implementation
  46. * Perl 5 with core modules (please read [NOTES-PERL.md](NOTES-PERL.md))
  47. * The Perl module `Text::Template` (please read [NOTES-PERL.md](NOTES-PERL.md))
  48. * an ANSI C compiler
  49. * a development environment in the form of development libraries and C
  50. header files
  51. * a supported operating system
  52. For additional platform specific requirements, solutions to specific
  53. issues and other details, please read one of these:
  54. * [Notes for UNIX-like platforms](NOTES-UNIX.md)
  55. * [Notes for Android platforms](NOTES-ANDROID.md)
  56. * [Notes for Windows platforms](NOTES-WINDOWS.md)
  57. * [Notes for the DOS platform with DJGPP](NOTES-DJGPP.md)
  58. * [Notes for the OpenVMS platform](NOTES-VMS.md)
  59. * [Notes on Perl](NOTES-PERL.md)
  60. * [Notes on Valgrind](NOTES-VALGRIND.md)
  61. Notational conventions
  62. ======================
  63. Throughout this document, we use the following conventions.
  64. Commands
  65. --------
  66. Any line starting with a dollar sign is a command line.
  67. $ command
  68. The dollar sign indicates the shell prompt and is not to be entered as
  69. part of the command.
  70. Choices
  71. -------
  72. Several words in curly braces separated by pipe characters indicate a
  73. **mandatory choice**, to be replaced with one of the given words.
  74. For example, the line
  75. $ echo { WORD1 | WORD2 | WORD3 }
  76. represents one of the following three commands
  77. $ echo WORD1
  78. - or -
  79. $ echo WORD2
  80. - or -
  81. $ echo WORD3
  82. One or several words in square brackets separated by pipe characters
  83. denote an **optional choice**. It is similar to the mandatory choice,
  84. but it can also be omitted entirely.
  85. So the line
  86. $ echo [ WORD1 | WORD2 | WORD3 ]
  87. represents one of the four commands
  88. $ echo WORD1
  89. - or -
  90. $ echo WORD2
  91. - or -
  92. $ echo WORD3
  93. - or -
  94. $ echo
  95. Arguments
  96. ---------
  97. **Mandatory arguments** are enclosed in double curly braces.
  98. A simple example would be
  99. $ type {{ filename }}
  100. which is to be understood to use the command `type` on some file name
  101. determined by the user.
  102. **Optional Arguments** are enclosed in double square brackets.
  103. [[ options ]]
  104. Note that the notation assumes spaces around `{`, `}`, `[`, `]`, `{{`, `}}` and
  105. `[[`, `]]`. This is to differentiate from OpenVMS directory
  106. specifications, which also use [ and ], but without spaces.
  107. Quick Installation Guide
  108. ========================
  109. If you just want to get OpenSSL installed without bothering too much
  110. about the details, here is the short version of how to build and install
  111. OpenSSL. If any of the following steps fails, please consult the
  112. [Installation in Detail](#installation-steps-in-detail) section below.
  113. Building OpenSSL
  114. ----------------
  115. Use the following commands to configure, build and test OpenSSL.
  116. The testing is optional, but recommended if you intend to install
  117. OpenSSL for production use.
  118. ### Unix / Linux / macOS
  119. $ ./Configure
  120. $ make
  121. $ make test
  122. ### OpenVMS
  123. Use the following commands to build OpenSSL:
  124. $ perl Configure
  125. $ mms
  126. $ mms test
  127. ### Windows
  128. If you are using Visual Studio, open a Developer Command Prompt and
  129. issue the following commands to build OpenSSL.
  130. $ perl Configure
  131. $ nmake
  132. $ nmake test
  133. As mentioned in the [Choices](#choices) section, you need to pick one
  134. of the four Configure targets in the first command.
  135. Most likely you will be using the `VC-WIN64A` target for 64bit Windows
  136. binaries (AMD64) or `VC-WIN32` for 32bit Windows binaries (X86).
  137. The other two options are `VC-WIN64I` (Intel IA64, Itanium) and
  138. `VC-CE` (Windows CE) are rather uncommon nowadays.
  139. Installing OpenSSL
  140. ------------------
  141. The following commands will install OpenSSL to a default system location.
  142. **Danger Zone:** even if you are impatient, please read the following two
  143. paragraphs carefully before you install OpenSSL.
  144. For security reasons the default system location is by default not writable
  145. for unprivileged users. So for the final installation step administrative
  146. privileges are required. The default system location and the procedure to
  147. obtain administrative privileges depends on the operating system.
  148. It is recommended to compile and test OpenSSL with normal user privileges
  149. and use administrative privileges only for the final installation step.
  150. On some platforms OpenSSL is preinstalled as part of the Operating System.
  151. In this case it is highly recommended not to overwrite the system versions,
  152. because other applications or libraries might depend on it.
  153. To avoid breaking other applications, install your copy of OpenSSL to a
  154. [different location](#installing-to-a-different-location) which is not in
  155. the global search path for system libraries.
  156. Finally, if you plan on using the FIPS module, you need to read the
  157. [Post-installation Notes](#post-installation-notes) further down.
  158. ### Unix / Linux / macOS
  159. Depending on your distribution, you need to run the following command as
  160. root user or prepend `sudo` to the command:
  161. $ make install
  162. By default, OpenSSL will be installed to
  163. /usr/local
  164. More precisely, the files will be installed into the subdirectories
  165. /usr/local/bin
  166. /usr/local/lib
  167. /usr/local/include
  168. ...
  169. depending on the file type, as it is custom on Unix-like operating systems.
  170. ### OpenVMS
  171. Use the following command to install OpenSSL.
  172. $ mms install
  173. By default, OpenSSL will be installed to
  175. ### Windows
  176. If you are using Visual Studio, open the Developer Command Prompt _elevated_
  177. and issue the following command.
  178. $ nmake install
  179. The easiest way to elevate the Command Prompt is to press and hold down
  180. the both the `<CTRL>` and `<SHIFT>` key while clicking the menu item in the
  181. task menu.
  182. The default installation location is
  183. C:\Program Files\OpenSSL
  184. for native binaries, or
  185. C:\Program Files (x86)\OpenSSL
  186. for 32bit binaries on 64bit Windows (WOW64).
  187. #### Installing to a different location
  188. To install OpenSSL to a different location (for example into your home
  189. directory for testing purposes) run `Configure` as shown in the following
  190. examples.
  191. The options `--prefix` and `--openssldir` are explained in further detail in
  192. [Directories](#directories) below, and the values used here are mere examples.
  193. On Unix:
  194. $ ./Configure --prefix=/opt/openssl --openssldir=/usr/local/ssl
  195. On OpenVMS:
  196. $ perl Configure --prefix=PROGRAM:[INSTALLS] --openssldir=SYS$MANAGER:[OPENSSL]
  197. Note: if you do add options to the configuration command, please make sure
  198. you've read more than just this Quick Start, such as relevant `NOTES-*` files,
  199. the options outline below, as configuration options may change the outcome
  200. in otherwise unexpected ways.
  201. Configuration Options
  202. =====================
  203. There are several options to `./Configure` to customize the build (note that
  204. for Windows, the defaults for `--prefix` and `--openssldir` depend on what
  205. configuration is used and what Windows implementation OpenSSL is built on.
  206. For more information, see the [Notes for Windows platforms](NOTES-WINDOWS.md).
  207. API Level
  208. ---------
  209. --api=x.y[.z]
  210. Build the OpenSSL libraries to support the API for the specified version.
  211. If [no-deprecated](#no-deprecated) is also given, don't build with support
  212. for deprecated APIs in or below the specified version number. For example,
  213. addding
  214. --api=1.1.0 no-deprecated
  215. will remove support for all APIs that were deprecated in OpenSSL version
  216. 1.1.0 or below. This is a rather specialized option for developers.
  217. If you just intend to remove all deprecated APIs up to the current version
  218. entirely, just specify [no-deprecated](#no-deprecated).
  219. If `--api` isn't given, it defaults to the current (minor) OpenSSL version.
  220. Cross Compile Prefix
  221. --------------------
  222. --cross-compile-prefix=<PREFIX>
  223. The `<PREFIX>` to include in front of commands for your toolchain.
  224. It is likely to have to end with dash, e.g. `a-b-c-` would invoke GNU compiler
  225. as `a-b-c-gcc`, etc. Unfortunately cross-compiling is too case-specific to put
  226. together one-size-fits-all instructions. You might have to pass more flags or
  227. set up environment variables to actually make it work. Android and iOS cases
  228. are discussed in corresponding `Configurations/15-*.conf` files. But there are
  229. cases when this option alone is sufficient. For example to build the mingw64
  230. target on Linux `--cross-compile-prefix=x86_64-w64-mingw32-` works. Naturally
  231. provided that mingw packages are installed. Today Debian and Ubuntu users
  232. have option to install a number of prepackaged cross-compilers along with
  233. corresponding run-time and development packages for "alien" hardware. To give
  234. another example `--cross-compile-prefix=mipsel-linux-gnu-` suffices in such
  235. case.
  236. For cross compilation, you must [configure manually](#manual-configuration).
  237. Also, note that `--openssldir` refers to target's file system, not one you are
  238. building on.
  239. Build Type
  240. ----------
  241. --debug
  242. Build OpenSSL with debugging symbols and zero optimization level.
  243. --release
  244. Build OpenSSL without debugging symbols. This is the default.
  245. Directories
  246. -----------
  247. ### libdir
  248. --libdir=DIR
  249. The name of the directory under the top of the installation directory tree
  250. (see the `--prefix` option) where libraries will be installed. By default
  251. this is `lib/`. Note that on Windows only static libraries (`*.lib`) will
  252. be stored in this location. Shared libraries (`*.dll`) will always be
  253. installed to the `bin/` directory.
  254. ### openssldir
  255. --openssldir=DIR
  256. Directory for OpenSSL configuration files, and also the default certificate
  257. and key store. Defaults are:
  258. Unix: /usr/local/ssl
  259. Windows: C:\Program Files\Common Files\SSL
  261. For 32bit Windows applications on Windows 64bit (WOW64), always replace
  262. `C:\Program Files` by `C:\Program Files (x86)`.
  263. ### prefix
  264. --prefix=DIR
  265. The top of the installation directory tree. Defaults are:
  266. Unix: /usr/local
  267. Windows: C:\Program Files\OpenSSL
  269. Compiler Warnings
  270. -----------------
  271. --strict-warnings
  272. This is a developer flag that switches on various compiler options recommended
  273. for OpenSSL development. It only works when using gcc or clang as the compiler.
  274. If you are developing a patch for OpenSSL then it is recommended that you use
  275. this option where possible.
  276. ZLib Flags
  277. ----------
  278. ### with-zlib-include
  279. --with-zlib-include=DIR
  280. The directory for the location of the zlib include file. This option is only
  281. necessary if [zlib](#zlib) is used and the include file is not
  282. already on the system include path.
  283. ### with-zlib-lib
  284. --with-zlib-lib=LIB
  285. **On Unix**: this is the directory containing the zlib library.
  286. If not provided the system library path will be used.
  287. **On Windows:** this is the filename of the zlib library (with or
  288. without a path). This flag must be provided if the
  289. [zlib-dynamic](#zlib-dynamic) option is not also used. If `zlib-dynamic` is used
  290. then this flag is optional and defaults to `ZLIB1` if not provided.
  291. **On VMS:** this is the filename of the zlib library (with or without a path).
  292. This flag is optional and if not provided then `GNV$LIBZSHR`, `GNV$LIBZSHR32`
  293. or `GNV$LIBZSHR64` is used by default depending on the pointer size chosen.
  294. Seeding the Random Generator
  295. ----------------------------
  296. --with-rand-seed=seed1[,seed2,...]
  297. A comma separated list of seeding methods which will be tried by OpenSSL
  298. in order to obtain random input (a.k.a "entropy") for seeding its
  299. cryptographically secure random number generator (CSPRNG).
  300. The current seeding methods are:
  301. ### os
  302. Use a trusted operating system entropy source.
  303. This is the default method if such an entropy source exists.
  304. ### getrandom
  305. Use the [getrandom(2)][man-getrandom] or equivalent system call.
  306. [man-getrandom]: http://man7.org/linux/man-pages/man2/getrandom.2.html
  307. ### devrandom
  308. Use the first device from the `DEVRANDOM` list which can be opened to read
  309. random bytes. The `DEVRANDOM` preprocessor constant expands to
  310. "/dev/urandom","/dev/random","/dev/srandom"
  311. on most unix-ish operating systems.
  312. ### egd
  313. Check for an entropy generating daemon.
  314. This source is ignored by the FIPS provider.
  315. ### rdcpu
  316. Use the `RDSEED` or `RDRAND` command if provided by the CPU.
  317. ### librandom
  318. Use librandom (not implemented yet).
  319. This source is ignored by the FIPS provider.
  320. ### none
  321. Disable automatic seeding. This is the default on some operating systems where
  322. no suitable entropy source exists, or no support for it is implemented yet.
  323. This option is ignored by the FIPS provider.
  324. For more information, see the section [Notes on random number generation][rng]
  325. at the end of this document.
  326. [rng]: #notes-on-random-number-generation
  327. Setting the FIPS HMAC key
  328. -------------------------
  329. --fips-key=value
  330. As part of its self-test validation, the FIPS module must verify itself
  331. by performing a SHA-256 HMAC computation on itself. The default key is
  332. the SHA256 value of "the holy handgrenade of antioch" and is sufficient
  333. for meeting the FIPS requirements.
  334. To change the key to a different value, use this flag. The value should
  335. be a hex string no more than 64 characters.
  336. Enable and Disable Features
  337. ---------------------------
  338. Feature options always come in pairs, an option to enable feature
  339. `xxxx`, and an option to disable it:
  340. [ enable-xxxx | no-xxxx ]
  341. Whether a feature is enabled or disabled by default, depends on the feature.
  342. In the following list, always the non-default variant is documented: if
  343. feature `xxxx` is disabled by default then `enable-xxxx` is documented and
  344. if feature `xxxx` is enabled by default then `no-xxxx` is documented.
  345. ### no-afalgeng
  346. Don't build the AFALG engine.
  347. This option will be forced on a platform that does not support AFALG.
  348. ### enable-ktls
  349. Build with Kernel TLS support.
  350. This option will enable the use of the Kernel TLS data-path, which can improve
  351. performance and allow for the use of sendfile and splice system calls on
  352. TLS sockets. The Kernel may use TLS accelerators if any are available on the
  353. system. This option will be forced off on systems that do not support the
  354. Kernel TLS data-path.
  355. ### enable-asan
  356. Build with the Address sanitiser.
  357. This is a developer option only. It may not work on all platforms and should
  358. never be used in production environments. It will only work when used with
  359. gcc or clang and should be used in conjunction with the [no-shared](#no-shared)
  360. option.
  361. ### enable-acvp-tests
  362. Build support for Automated Cryptographic Validation Protocol (ACVP)
  363. tests.
  364. This is required for FIPS validation purposes. Certain ACVP tests require
  365. access to algorithm internals that are not normally accessible.
  366. Additional information related to ACVP can be found at
  367. <https://github.com/usnistgov/ACVP>.
  368. ### no-asm
  369. Do not use assembler code.
  370. This should be viewed as debugging/troubleshooting option rather than for
  371. production use. On some platforms a small amount of assembler code may still
  372. be used even with this option.
  373. ### no-async
  374. Do not build support for async operations.
  375. ### no-autoalginit
  376. Don't automatically load all supported ciphers and digests.
  377. Typically OpenSSL will make available all of its supported ciphers and digests.
  378. For a statically linked application this may be undesirable if small executable
  379. size is an objective. This only affects libcrypto. Ciphers and digests will
  380. have to be loaded manually using `EVP_add_cipher()` and `EVP_add_digest()`
  381. if this option is used. This option will force a non-shared build.
  382. ### no-autoerrinit
  383. Don't automatically load all libcrypto/libssl error strings.
  384. Typically OpenSSL will automatically load human readable error strings. For a
  385. statically linked application this may be undesirable if small executable size
  386. is an objective.
  387. ### no-autoload-config
  388. Don't automatically load the default `openssl.cnf` file.
  389. Typically OpenSSL will automatically load a system config file which configures
  390. default SSL options.
  391. ### enable-buildtest-c++
  392. While testing, generate C++ buildtest files that simply check that the public
  393. OpenSSL header files are usable standalone with C++.
  394. Enabling this option demands extra care. For any compiler flag given directly
  395. as configuration option, you must ensure that it's valid for both the C and
  396. the C++ compiler. If not, the C++ build test will most likely break. As an
  397. alternative, you can use the language specific variables, `CFLAGS` and `CXXFLAGS`.
  398. ### no-bulk
  399. Build only some minimal set of features.
  400. This is a developer option used internally for CI build tests of the project.
  401. ### no-cached-fetch
  402. Never cache algorithms when they are fetched from a provider. Normally, a
  403. provider indicates if the algorithms it supplies can be cached or not. Using
  404. this option will reduce run-time memory usage but it also introduces a
  405. significant performance penalty. This option is primarily designed to help
  406. with detecting incorrect reference counting.
  407. ### no-capieng
  408. Don't build the CAPI engine.
  409. This option will be forced if on a platform that does not support CAPI.
  410. ### no-cmp
  411. Don't build support for Certificate Management Protocol (CMP)
  412. and Certificate Request Message Format (CRMF).
  413. ### no-cms
  414. Don't build support for Cryptographic Message Syntax (CMS).
  415. ### no-comp
  416. Don't build support for SSL/TLS compression.
  417. If this option is enabled (the default), then compression will only work if
  418. the zlib or `zlib-dynamic` options are also chosen.
  419. ### enable-crypto-mdebug
  420. This now only enables the `failed-malloc` feature.
  421. ### enable-crypto-mdebug-backtrace
  422. This is a no-op; the project uses the compiler's address/leak sanitizer instead.
  423. ### no-ct
  424. Don't build support for Certificate Transparency (CT).
  425. ### no-deprecated
  426. Don't build with support for deprecated APIs up until and including the version
  427. given with `--api` (or the current version, if `--api` wasn't specified).
  428. ### no-dgram
  429. Don't build support for datagram based BIOs.
  430. Selecting this option will also force the disabling of DTLS.
  431. ### no-dso
  432. Don't build support for loading Dynamic Shared Objects (DSO)
  433. ### enable-devcryptoeng
  434. Build the `/dev/crypto` engine.
  435. This option is automatically selected on the BSD platform, in which case it can
  436. be disabled with `no-devcryptoeng`.
  437. ### no-dynamic-engine
  438. Don't build the dynamically loaded engines.
  439. This only has an effect in a shared build.
  440. ### no-ec
  441. Don't build support for Elliptic Curves.
  442. ### no-ec2m
  443. Don't build support for binary Elliptic Curves
  444. ### enable-ec_nistp_64_gcc_128
  445. Enable support for optimised implementations of some commonly used NIST
  446. elliptic curves.
  447. This option is only supported on platforms:
  448. - with little-endian storage of non-byte types
  449. - that tolerate misaligned memory references
  450. - where the compiler:
  451. - supports the non-standard type `__uint128_t`
  452. - defines the built-in macro `__SIZEOF_INT128__`
  453. ### enable-egd
  454. Build support for gathering entropy from the Entropy Gathering Daemon (EGD).
  455. ### no-engine
  456. Don't build support for loading engines.
  457. ### no-err
  458. Don't compile in any error strings.
  459. ### enable-external-tests
  460. Enable building of integration with external test suites.
  461. This is a developer option and may not work on all platforms. The following
  462. external test suites are currently supported:
  463. - GOST engine test suite
  464. - Python PYCA/Cryptography test suite
  465. - krb5 test suite
  466. See the file [test/README-external.md](test/README-external.md)
  467. for further details.
  468. ### no-filenames
  469. Don't compile in filename and line number information (e.g. for errors and
  470. memory allocation).
  471. ### enable-fips
  472. Build (and install) the FIPS provider
  473. ### no-fips-securitychecks
  474. Don't perform FIPS module run-time checks related to enforcement of security
  475. parameters such as minimum security strength of keys.
  476. ### enable-fuzz-libfuzzer, enable-fuzz-afl
  477. Build with support for fuzzing using either libfuzzer or AFL.
  478. These are developer options only. They may not work on all platforms and
  479. should never be used in production environments.
  480. See the file [fuzz/README.md](fuzz/README.md) for further details.
  481. ### no-gost
  482. Don't build support for GOST based ciphersuites.
  483. Note that if this feature is enabled then GOST ciphersuites are only available
  484. if the GOST algorithms are also available through loading an externally supplied
  485. engine.
  486. ### no-legacy
  487. Don't build the legacy provider.
  488. Disabling this also disables the legacy algorithms: MD2 (already disabled by default).
  489. ### no-makedepend
  490. Don't generate dependencies.
  491. ### no-module
  492. Don't build any dynamically loadable engines.
  493. This also implies `no-dynamic-engine`.
  494. ### no-multiblock
  495. Don't build support for writing multiple records in one go in libssl
  496. Note: this is a different capability to the pipelining functionality.
  497. ### no-nextprotoneg
  498. Don't build support for the Next Protocol Negotiation (NPN) TLS extension.
  499. ### no-ocsp
  500. Don't build support for Online Certificate Status Protocol (OCSP).
  501. ### no-padlockeng
  502. Don't build the padlock engine.
  503. ### no-hw-padlock
  504. As synonym for `no-padlockeng`. Deprecated and should not be used.
  505. ### no-pic
  506. Don't build with support for Position Independent Code.
  507. ### no-pinshared
  508. Don't pin the shared libraries.
  509. By default OpenSSL will attempt to stay in memory until the process exits.
  510. This is so that libcrypto and libssl can be properly cleaned up automatically
  511. via an `atexit()` handler. The handler is registered by libcrypto and cleans
  512. up both libraries. On some platforms the `atexit()` handler will run on unload of
  513. libcrypto (if it has been dynamically loaded) rather than at process exit. This
  514. option can be used to stop OpenSSL from attempting to stay in memory until the
  515. process exits. This could lead to crashes if either libcrypto or libssl have
  516. already been unloaded at the point that the atexit handler is invoked, e.g. on a
  517. platform which calls `atexit()` on unload of the library, and libssl is unloaded
  518. before libcrypto then a crash is likely to happen. Applications can suppress
  519. running of the `atexit()` handler at run time by using the
  520. `OPENSSL_INIT_NO_ATEXIT` option to `OPENSSL_init_crypto()`.
  521. See the man page for it for further details.
  522. ### no-posix-io
  523. Don't use POSIX IO capabilities.
  524. ### no-psk
  525. Don't build support for Pre-Shared Key based ciphersuites.
  526. ### no-rdrand
  527. Don't use hardware RDRAND capabilities.
  528. ### no-rfc3779
  529. Don't build support for RFC3779, "X.509 Extensions for IP Addresses and
  530. AS Identifiers".
  531. ### sctp
  532. Build support for Stream Control Transmission Protocol (SCTP).
  533. ### no-shared
  534. Do not create shared libraries, only static ones.
  535. See [Notes on shared libraries](#notes-on-shared-libraries) below.
  536. ### no-sock
  537. Don't build support for socket BIOs.
  538. ### no-srp
  539. Don't build support for Secure Remote Password (SRP) protocol or
  540. SRP based ciphersuites.
  541. ### no-srtp
  542. Don't build Secure Real-Time Transport Protocol (SRTP) support.
  543. ### no-sse2
  544. Exclude SSE2 code paths from 32-bit x86 assembly modules.
  545. Normally SSE2 extension is detected at run-time, but the decision whether or not
  546. the machine code will be executed is taken solely on CPU capability vector. This
  547. means that if you happen to run OS kernel which does not support SSE2 extension
  548. on Intel P4 processor, then your application might be exposed to "illegal
  549. instruction" exception. There might be a way to enable support in kernel, e.g.
  550. FreeBSD kernel can be compiled with `CPU_ENABLE_SSE`, and there is a way to
  551. disengage SSE2 code paths upon application start-up, but if you aim for wider
  552. "audience" running such kernel, consider `no-sse2`. Both the `386` and `no-asm`
  553. options imply `no-sse2`.
  554. ### enable-ssl-trace
  555. Build with the SSL Trace capabilities.
  556. This adds the `-trace` option to `s_client` and `s_server`.
  557. ### no-static-engine
  558. Don't build the statically linked engines.
  559. This only has an impact when not built "shared".
  560. ### no-stdio
  561. Don't use anything from the C header file `stdio.h` that makes use of the `FILE`
  562. type. Only libcrypto and libssl can be built in this way. Using this option will
  563. suppress building the command line applications. Additionally, since the OpenSSL
  564. tests also use the command line applications, the tests will also be skipped.
  565. ### no-tests
  566. Don't build test programs or run any tests.
  567. ### no-threads
  568. Don't build with support for multi-threaded applications.
  569. ### threads
  570. Build with support for multi-threaded applications. Most platforms will enable
  571. this by default. However, if on a platform where this is not the case then this
  572. will usually require additional system-dependent options!
  573. See [Notes on multi-threading](#notes-on-multi-threading) below.
  574. ### enable-trace
  575. Build with support for the integrated tracing api.
  576. See manual pages OSSL_trace_set_channel(3) and OSSL_trace_enabled(3) for details.
  577. ### no-ts
  578. Don't build Time Stamping (TS) Authority support.
  579. ### enable-ubsan
  580. Build with the Undefined Behaviour sanitiser (UBSAN).
  581. This is a developer option only. It may not work on all platforms and should
  582. never be used in production environments. It will only work when used with
  583. gcc or clang and should be used in conjunction with the `-DPEDANTIC` option
  584. (or the `--strict-warnings` option).
  585. ### no-ui-console
  586. Don't build with the User Interface (UI) console method
  587. The User Interface console method enables text based console prompts.
  588. ### enable-unit-test
  589. Enable additional unit test APIs.
  590. This should not typically be used in production deployments.
  591. ### no-uplink
  592. Don't build support for UPLINK interface.
  593. ### enable-weak-ssl-ciphers
  594. Build support for SSL/TLS ciphers that are considered "weak"
  595. Enabling this includes for example the RC4 based ciphersuites.
  596. ### zlib
  597. Build with support for zlib compression/decompression.
  598. ### zlib-dynamic
  599. Like the zlib option, but has OpenSSL load the zlib library dynamically
  600. when needed.
  601. This is only supported on systems where loading of shared libraries is supported.
  602. ### 386
  603. In 32-bit x86 builds, use the 80386 instruction set only in assembly modules
  604. The default x86 code is more efficient, but requires at least an 486 processor.
  605. Note: This doesn't affect compiler generated code, so this option needs to be
  606. accompanied by a corresponding compiler-specific option.
  607. ### no-{protocol}
  608. no-{ssl|ssl3|tls|tls1|tls1_1|tls1_2|tls1_3|dtls|dtls1|dtls1_2}
  609. Don't build support for negotiating the specified SSL/TLS protocol.
  610. If `no-tls` is selected then all of `tls1`, `tls1_1`, `tls1_2` and `tls1_3`
  611. are disabled.
  612. Similarly `no-dtls` will disable `dtls1` and `dtls1_2`. The `no-ssl` option is
  613. synonymous with `no-ssl3`. Note this only affects version negotiation.
  614. OpenSSL will still provide the methods for applications to explicitly select
  615. the individual protocol versions.
  616. ### no-{protocol}-method
  617. no-{ssl|ssl3|tls|tls1|tls1_1|tls1_2|tls1_3|dtls|dtls1|dtls1_2}-method
  618. Analogous to `no-{protocol}` but in addition do not build the methods for
  619. applications to explicitly select individual protocol versions. Note that there
  620. is no `no-tls1_3-method` option because there is no application method for
  621. TLSv1.3.
  622. Using individual protocol methods directly is deprecated. Applications should
  623. use `TLS_method()` instead.
  624. ### enable-{algorithm}
  625. enable-{md2|rc5}
  626. Build with support for the specified algorithm.
  627. ### no-{algorithm}
  628. no-{aria|bf|blake2|camellia|cast|chacha|cmac|
  629. des|dh|dsa|ecdh|ecdsa|idea|md4|mdc2|ocb|
  630. poly1305|rc2|rc4|rmd160|scrypt|seed|
  631. siphash|siv|sm2|sm3|sm4|whirlpool}
  632. Build without support for the specified algorithm.
  633. The `ripemd` algorithm is deprecated and if used is synonymous with `rmd160`.
  634. ### Compiler-specific options
  635. -Dxxx, -Ixxx, -Wp, -lxxx, -Lxxx, -Wl, -rpath, -R, -framework, -static
  636. These system specific options will be recognised and passed through to the
  637. compiler to allow you to define preprocessor symbols, specify additional
  638. libraries, library directories or other compiler options. It might be worth
  639. noting that some compilers generate code specifically for processor the
  640. compiler currently executes on. This is not necessarily what you might have
  641. in mind, since it might be unsuitable for execution on other, typically older,
  642. processor. Consult your compiler documentation.
  643. Take note of the [Environment Variables](#environment-variables) documentation
  644. below and how these flags interact with those variables.
  645. -xxx, +xxx, /xxx
  646. Additional options that are not otherwise recognised are passed through as
  647. they are to the compiler as well. Unix-style options beginning with a
  648. `-` or `+` and Windows-style options beginning with a `/` are recognized.
  649. Again, consult your compiler documentation.
  650. If the option contains arguments separated by spaces, then the URL-style
  651. notation `%20` can be used for the space character in order to avoid having
  652. to quote the option. For example, `-opt%20arg` gets expanded to `-opt arg`.
  653. In fact, any ASCII character can be encoded as %xx using its hexadecimal
  654. encoding.
  655. Take note of the [Environment Variables](#environment-variables) documentation
  656. below and how these flags interact with those variables.
  657. ### Environment Variables
  658. VAR=value
  659. Assign the given value to the environment variable `VAR` for `Configure`.
  660. These work just like normal environment variable assignments, but are supported
  661. on all platforms and are confined to the configuration scripts only.
  662. These assignments override the corresponding value in the inherited environment,
  663. if there is one.
  664. The following variables are used as "`make` variables" and can be used as an
  665. alternative to giving preprocessor, compiler and linker options directly as
  666. configuration. The following variables are supported:
  667. AR The static library archiver.
  668. ARFLAGS Flags for the static library archiver.
  669. AS The assembler compiler.
  670. ASFLAGS Flags for the assembler compiler.
  671. CC The C compiler.
  672. CFLAGS Flags for the C compiler.
  673. CXX The C++ compiler.
  674. CXXFLAGS Flags for the C++ compiler.
  675. CPP The C/C++ preprocessor.
  676. CPPFLAGS Flags for the C/C++ preprocessor.
  677. CPPDEFINES List of CPP macro definitions, separated
  678. by a platform specific character (':' or
  679. space for Unix, ';' for Windows, ',' for
  680. VMS). This can be used instead of using
  681. -D (or what corresponds to that on your
  682. compiler) in CPPFLAGS.
  683. CPPINCLUDES List of CPP inclusion directories, separated
  684. the same way as for CPPDEFINES. This can
  685. be used instead of -I (or what corresponds
  686. to that on your compiler) in CPPFLAGS.
  687. HASHBANGPERL Perl invocation to be inserted after '#!'
  688. in public perl scripts (only relevant on
  689. Unix).
  690. LD The program linker (not used on Unix, $(CC)
  691. is used there).
  692. LDFLAGS Flags for the shared library, DSO and
  693. program linker.
  694. LDLIBS Extra libraries to use when linking.
  695. Takes the form of a space separated list
  696. of library specifications on Unix and
  697. Windows, and as a comma separated list of
  698. libraries on VMS.
  699. RANLIB The library archive indexer.
  700. RC The Windows resource compiler.
  701. RCFLAGS Flags for the Windows resource compiler.
  702. RM The command to remove files and directories.
  703. These cannot be mixed with compiling/linking flags given on the command line.
  704. In other words, something like this isn't permitted.
  705. $ ./Configure -DFOO CPPFLAGS=-DBAR -DCOOKIE
  706. Backward compatibility note:
  707. To be compatible with older configuration scripts, the environment variables
  708. are ignored if compiling/linking flags are given on the command line, except
  709. for the following:
  711. For example, the following command will not see `-DBAR`:
  712. $ CPPFLAGS=-DBAR ./Configure -DCOOKIE
  713. However, the following will see both set variables:
  714. $ CC=gcc CROSS_COMPILE=x86_64-w64-mingw32- ./Configure -DCOOKIE
  715. If `CC` is set, it is advisable to also set `CXX` to ensure both the C and C++
  716. compiler are in the same "family". This becomes relevant with
  717. `enable-external-tests` and `enable-buildtest-c++`.
  718. ### Reconfigure
  719. reconf
  720. reconfigure
  721. Reconfigure from earlier data.
  722. This fetches the previous command line options and environment from data
  723. saved in `configdata.pm` and runs the configuration process again, using
  724. these options and environment. Note: NO other option is permitted together
  725. with `reconf`. Note: The original configuration saves away values for ALL
  726. environment variables that were used, and if they weren't defined, they are
  727. still saved away with information that they weren't originally defined.
  728. This information takes precedence over environment variables that are
  729. defined when reconfiguring.
  730. Displaying configuration data
  731. -----------------------------
  732. The configuration script itself will say very little, and finishes by
  733. creating `configdata.pm`. This perl module can be loaded by other scripts
  734. to find all the configuration data, and it can also be used as a script to
  735. display all sorts of configuration data in a human readable form.
  736. For more information, please do:
  737. $ ./configdata.pm --help # Unix
  738. or
  739. $ perl configdata.pm --help # Windows and VMS
  740. Installation Steps in Detail
  741. ============================
  742. Configure OpenSSL
  743. -----------------
  744. ### Automatic Configuration
  745. On some platform a `config` script is available which attempts to guess
  746. your operating system (and compiler, if necessary) and calls the `Configure`
  747. Perl script with appropriate target based on its guess. Further options can
  748. be supplied to the `config` script, which will be passed on to the `Configure`
  749. script.
  750. #### Unix / Linux / macOS
  751. $ ./Configure [[ options ]]
  752. #### OpenVMS
  753. $ perl Configure [[ options ]]
  754. #### Windows
  755. $ perl Configure [[ options ]]
  756. ### Manual Configuration
  757. OpenSSL knows about a range of different operating system, hardware and
  758. compiler combinations. To see the ones it knows about, run
  759. $ ./Configure LIST # Unix
  760. or
  761. $ perl Configure LIST # All other platforms
  762. For the remainder of this text, the Unix form will be used in all examples.
  763. Please use the appropriate form for your platform.
  764. Pick a suitable name from the list that matches your system. For most
  765. operating systems there is a choice between using cc or gcc.
  766. When you have identified your system (and if necessary compiler) use this
  767. name as the argument to `Configure`. For example, a `linux-elf` user would
  768. run:
  769. $ ./Configure linux-elf [[ options ]]
  770. ### Creating your own Configuration
  771. If your system isn't listed, you will have to create a configuration
  772. file named `Configurations/{{ something }}.conf` and add the correct
  773. configuration for your system. See the available configs as examples
  774. and read [Configurations/README.md](Configurations/README.md) and
  775. [Configurations/README-design.md](Configurations/README-design.md)
  776. for more information.
  777. The generic configurations `cc` or `gcc` should usually work on 32 bit
  778. Unix-like systems.
  779. `Configure` creates a build file (`Makefile` on Unix, `makefile` on Windows
  780. and `descrip.mms` on OpenVMS) from a suitable template in `Configurations/`,
  781. and defines various macros in `include/openssl/configuration.h` (generated
  782. from `include/openssl/configuration.h.in`.
  783. ### Out of Tree Builds
  784. OpenSSL can be configured to build in a build directory separate from the
  785. source code directory. It's done by placing yourself in some other
  786. directory and invoking the configuration commands from there.
  787. #### Unix example
  788. $ mkdir /var/tmp/openssl-build
  789. $ cd /var/tmp/openssl-build
  790. $ /PATH/TO/OPENSSL/SOURCE/Configure [[ options ]]
  791. #### OpenVMS example
  792. $ set default sys$login:
  793. $ create/dir [.tmp.openssl-build]
  794. $ set default [.tmp.openssl-build]
  795. $ perl D:[PATH.TO.OPENSSL.SOURCE]Configure [[ options ]]
  796. #### Windows example
  797. $ C:
  798. $ mkdir \temp-openssl
  799. $ cd \temp-openssl
  800. $ perl d:\PATH\TO\OPENSSL\SOURCE\Configure [[ options ]]
  801. Paths can be relative just as well as absolute. `Configure` will do its best
  802. to translate them to relative paths whenever possible.
  803. Build OpenSSL
  804. -------------
  805. Build OpenSSL by running:
  806. $ make # Unix
  807. $ mms ! (or mmk) OpenVMS
  808. $ nmake # Windows
  809. This will build the OpenSSL libraries (`libcrypto.a` and `libssl.a` on
  810. Unix, corresponding on other platforms) and the OpenSSL binary
  811. (`openssl`). The libraries will be built in the top-level directory,
  812. and the binary will be in the `apps/` subdirectory.
  813. If the build fails, take a look at the [Build Failures](#build-failures)
  814. subsection of the [Troubleshooting](#troubleshooting) section.
  815. Test OpenSSL
  816. ------------
  817. After a successful build, and before installing, the libraries should
  818. be tested. Run:
  819. $ make test # Unix
  820. $ mms test ! OpenVMS
  821. $ nmake test # Windows
  822. **Warning:** you MUST run the tests from an unprivileged account (or disable
  823. your privileges temporarily if your platform allows it).
  824. See [test/README.md](test/README.md) for further details how run tests.
  825. See [test/README-dev.md](test/README-dev.md) for guidelines on adding tests.
  826. Install OpenSSL
  827. ---------------
  828. If everything tests ok, install OpenSSL with
  829. $ make install # Unix
  830. $ mms install ! OpenVMS
  831. $ nmake install # Windows
  832. Note that in order to perform the install step above you need to have
  833. appropriate permissions to write to the installation directory.
  834. The above commands will install all the software components in this
  835. directory tree under `<PREFIX>` (the directory given with `--prefix` or
  836. its default):
  837. ### Unix / Linux / macOS
  838. bin/ Contains the openssl binary and a few other
  839. utility scripts.
  840. include/openssl
  841. Contains the header files needed if you want
  842. to build your own programs that use libcrypto
  843. or libssl.
  844. lib Contains the OpenSSL library files.
  845. lib/engines Contains the OpenSSL dynamically loadable engines.
  846. share/man/man1 Contains the OpenSSL command line man-pages.
  847. share/man/man3 Contains the OpenSSL library calls man-pages.
  848. share/man/man5 Contains the OpenSSL configuration format man-pages.
  849. share/man/man7 Contains the OpenSSL other misc man-pages.
  850. share/doc/openssl/html/man1
  851. share/doc/openssl/html/man3
  852. share/doc/openssl/html/man5
  853. share/doc/openssl/html/man7
  854. Contains the HTML rendition of the man-pages.
  855. ### OpenVMS
  856. 'arch' is replaced with the architecture name, `ALPHA` or `IA64`,
  857. 'sover' is replaced with the shared library version (`0101` for 1.1), and
  858. 'pz' is replaced with the pointer size OpenSSL was built with:
  859. [.EXE.'arch'] Contains the openssl binary.
  860. [.EXE] Contains a few utility scripts.
  861. [.include.openssl]
  862. Contains the header files needed if you want
  863. to build your own programs that use libcrypto
  864. or libssl.
  865. [.LIB.'arch'] Contains the OpenSSL library files.
  866. [.ENGINES'sover''pz'.'arch']
  867. Contains the OpenSSL dynamically loadable engines.
  868. [.SYS$STARTUP] Contains startup, login and shutdown scripts.
  869. These define appropriate logical names and
  870. command symbols.
  871. [.SYSTEST] Contains the installation verification procedure.
  872. [.HTML] Contains the HTML rendition of the manual pages.
  873. ### Additional Directories
  874. Additionally, install will add the following directories under
  875. OPENSSLDIR (the directory given with `--openssldir` or its default)
  876. for you convenience:
  877. certs Initially empty, this is the default location
  878. for certificate files.
  879. private Initially empty, this is the default location
  880. for private key files.
  881. misc Various scripts.
  882. The installation directory should be appropriately protected to ensure
  883. unprivileged users cannot make changes to OpenSSL binaries or files, or
  884. install engines. If you already have a pre-installed version of OpenSSL as
  885. part of your Operating System it is recommended that you do not overwrite
  886. the system version and instead install to somewhere else.
  887. Package builders who want to configure the library for standard locations,
  888. but have the package installed somewhere else so that it can easily be
  889. packaged, can use
  890. $ make DESTDIR=/tmp/package-root install # Unix
  891. $ mms/macro="DESTDIR=TMP:[PACKAGE-ROOT]" install ! OpenVMS
  892. The specified destination directory will be prepended to all installation
  893. target paths.
  894. Compatibility issues with previous OpenSSL versions
  895. ---------------------------------------------------
  896. ### COMPILING existing applications
  897. Starting with version 1.1.0, OpenSSL hides a number of structures that were
  898. previously open. This includes all internal libssl structures and a number
  899. of EVP types. Accessor functions have been added to allow controlled access
  900. to the structures' data.
  901. This means that some software needs to be rewritten to adapt to the new ways
  902. of doing things. This often amounts to allocating an instance of a structure
  903. explicitly where you could previously allocate them on the stack as automatic
  904. variables, and using the provided accessor functions where you would previously
  905. access a structure's field directly.
  906. Some APIs have changed as well. However, older APIs have been preserved when
  907. possible.
  908. Post-installation Notes
  909. -----------------------
  910. With the default OpenSSL installation comes a FIPS provider module, which
  911. needs some post-installation attention, without which it will not be usable.
  912. This involves using the following command:
  913. $ openssl fipsinstall
  914. See the openssl-fipsinstall(1) manual for details and examples.
  915. Advanced Build Options
  916. ======================
  917. Environment Variables
  918. ---------------------
  919. A number of environment variables can be used to provide additional control
  920. over the build process. Typically these should be defined prior to running
  921. `Configure`. Not all environment variables are relevant to all platforms.
  922. AR
  923. The name of the ar executable to use.
  925. Use a different build file name than the platform default
  926. ("Makefile" on Unix-like platforms, "makefile" on native Windows,
  927. "descrip.mms" on OpenVMS). This requires that there is a
  928. corresponding build file template.
  929. See [Configurations/README.md](Configurations/README.md)
  930. for further information.
  931. CC
  932. The compiler to use. Configure will attempt to pick a default
  933. compiler for your platform but this choice can be overridden
  934. using this variable. Set it to the compiler executable you wish
  935. to use, e.g. gcc or clang.
  937. This environment variable has the same meaning as for the
  938. "--cross-compile-prefix" Configure flag described above. If both
  939. are set then the Configure flag takes precedence.
  940. NM
  941. The name of the nm executable to use.
  943. OpenSSL comes with a database of information about how it
  944. should be built on different platforms as well as build file
  945. templates for those platforms. The database is comprised of
  946. ".conf" files in the Configurations directory. The build
  947. file templates reside there as well as ".tmpl" files. See the
  948. file [Configurations/README.md](Configurations/README.md)
  949. for further information about the format of ".conf" files
  950. as well as information on the ".tmpl" files.
  951. In addition to the standard ".conf" and ".tmpl" files, it is
  952. possible to create your own ".conf" and ".tmpl" files and
  953. store them locally, outside the OpenSSL source tree.
  954. This environment variable can be set to the directory where
  955. these files are held and will be considered by Configure
  956. before it looks in the standard directories.
  957. PERL
  958. The name of the Perl executable to use when building OpenSSL.
  959. Only needed if builing should use a different Perl executable
  960. than what is used to run the Configure script.
  962. The command string for the Perl executable to insert in the
  963. #! line of perl scripts that will be publicly installed.
  964. Default: /usr/bin/env perl
  965. Note: the value of this variable is added to the same scripts
  966. on all platforms, but it's only relevant on Unix-like platforms.
  967. RC
  968. The name of the rc executable to use. The default will be as
  969. defined for the target platform in the ".conf" file. If not
  970. defined then "windres" will be used. The WINDRES environment
  971. variable is synonymous to this. If both are defined then RC
  972. takes precedence.
  973. RANLIB
  974. The name of the ranlib executable to use.
  975. WINDRES
  976. See RC.
  977. Makefile Targets
  978. ----------------
  979. The `Configure` script generates a Makefile in a format relevant to the specific
  980. platform. The Makefiles provide a number of targets that can be used. Not all
  981. targets may be available on all platforms. Only the most common targets are
  982. described here. Examine the Makefiles themselves for the full list.
  983. all
  984. The target to build all the software components and
  985. documentation.
  986. build_sw
  987. Build all the software components.
  989. build_docs
  990. Build all documentation components.
  991. clean
  992. Remove all build artefacts and return the directory to a "clean"
  993. state.
  994. depend
  995. Rebuild the dependencies in the Makefiles. This is a legacy
  996. option that no longer needs to be used since OpenSSL 1.1.0.
  997. install
  998. Install all OpenSSL components.
  999. install_sw
  1000. Only install the OpenSSL software components.
  1001. install_docs
  1002. Only install the OpenSSL documentation components.
  1003. install_man_docs
  1004. Only install the OpenSSL man pages (Unix only).
  1005. install_html_docs
  1006. Only install the OpenSSL HTML documentation.
  1007. install_fips
  1008. Install the FIPS provider module configuration file.
  1009. list-tests
  1010. Prints a list of all the self test names.
  1011. test
  1012. Build and run the OpenSSL self tests.
  1013. uninstall
  1014. Uninstall all OpenSSL components.
  1015. reconfigure
  1016. reconf
  1017. Re-run the configuration process, as exactly as the last time
  1018. as possible.
  1019. update
  1020. This is a developer option. If you are developing a patch for
  1021. OpenSSL you may need to use this if you want to update
  1022. automatically generated files; add new error codes or add new
  1023. (or change the visibility of) public API functions. (Unix only).
  1024. Running Selected Tests
  1025. ----------------------
  1026. You can specify a set of tests to be performed
  1027. using the `make` variable `TESTS`.
  1028. See the section [Running Selected Tests of
  1029. test/README.md](test/README.md#running-selected-tests).
  1030. Troubleshooting
  1031. ===============
  1032. Configuration Problems
  1033. ----------------------
  1034. ### Selecting the correct target
  1035. The `./Configure` script tries hard to guess your operating system, but in some
  1036. cases it does not succeed. You will see a message like the following:
  1037. $ ./Configure
  1038. Operating system: x86-whatever-minix
  1039. This system (minix) is not supported. See file INSTALL.md for details.
  1040. Even if the automatic target selection by the `./Configure` script fails,
  1041. chances are that you still might find a suitable target in the `Configurations`
  1042. directory, which you can supply to the `./Configure` command,
  1043. possibly after some adjustment.
  1044. The `Configurations/` directory contains a lot of examples of such targets.
  1045. The main configuration file is [10-main.conf], which contains all targets that
  1046. are officially supported by the OpenSSL team. Other configuration files contain
  1047. targets contributed by other OpenSSL users. The list of targets can be found in
  1048. a Perl list `my %targets = ( ... )`.
  1049. my %targets = (
  1050. ...
  1051. "target-name" => {
  1052. inherit_from => [ "base-target" ],
  1053. CC => "...",
  1054. cflags => add("..."),
  1055. asm_arch => '...',
  1056. perlasm_scheme => "...",
  1057. },
  1058. ...
  1059. )
  1060. If you call `./Configure` without arguments, it will give you a list of all
  1061. known targets. Using `grep`, you can lookup the target definition in the
  1062. `Configurations/` directory. For example the `android-x86_64` can be found in
  1063. [Configurations/15-android.conf](Configurations/15-android.conf).
  1064. The directory contains two README files, which explain the general syntax and
  1065. design of the configuration files.
  1066. - [Configurations/README.md](Configurations/README.md)
  1067. - [Configurations/README-design.md](Configurations/README-design.md)
  1068. If you need further help, try to search the [openssl-users] mailing list
  1069. or the [GitHub Issues] for existing solutions. If you don't find anything,
  1070. you can [raise an issue] to ask a question yourself.
  1071. More about our support resources can be found in the [SUPPORT] file.
  1072. ### Configuration Errors
  1073. If the `./Configure` or `./Configure` command fails with an error message,
  1074. read the error message carefully and try to figure out whether you made
  1075. a mistake (e.g., by providing a wrong option), or whether the script is
  1076. working incorrectly. If you think you encountered a bug, please
  1077. [raise an issue] on GitHub to file a bug report.
  1078. Along with a short description of the bug, please provide the complete
  1079. configure command line and the relevant output including the error message.
  1080. Note: To make the output readable, pleace add a 'code fence' (three backquotes
  1081. ` ``` ` on a separate line) before and after your output:
  1082. ```
  1083. ./Configure [your arguments...]
  1084. [output...]
  1085. ```
  1086. Build Failures
  1087. --------------
  1088. If the build fails, look carefully at the output. Try to locate and understand
  1089. the error message. It might be that the compiler is already telling you
  1090. exactly what you need to do to fix your problem.
  1091. There may be reasons for the failure that aren't problems in OpenSSL itself,
  1092. for example if the compiler reports missing standard or third party headers.
  1093. If the build succeeded previously, but fails after a source or configuration
  1094. change, it might be helpful to clean the build tree before attempting another
  1095. build. Use this command:
  1096. $ make clean # Unix
  1097. $ mms clean ! (or mmk) OpenVMS
  1098. $ nmake clean # Windows
  1099. Assembler error messages can sometimes be sidestepped by using the `no-asm`
  1100. configuration option. See also [notes](#notes-on-assembler-modules-compilation).
  1101. Compiling parts of OpenSSL with gcc and others with the system compiler will
  1102. result in unresolved symbols on some systems.
  1103. If you are still having problems, try to search the [openssl-users] mailing
  1104. list or the [GitHub Issues] for existing solutions. If you think you
  1105. encountered an OpenSSL bug, please [raise an issue] to file a bug report.
  1106. Please take the time to review the existing issues first; maybe the bug was
  1107. already reported or has already been fixed.
  1108. Test Failures
  1109. -------------
  1110. If some tests fail, look at the output. There may be reasons for the failure
  1111. that isn't a problem in OpenSSL itself (like an OS malfunction or a Perl issue).
  1112. You may want increased verbosity, that can be accomplished as described in
  1113. section [Test Failures of test/README.md](test/README.md#test-failures).
  1114. You may also want to selectively specify which test(s) to perform. This can be
  1115. done using the `make` variable `TESTS` as described in section [Running
  1116. Selected Tests of test/README.md](test/README.md#running-selected-tests).
  1117. If you find a problem with OpenSSL itself, try removing any
  1118. compiler optimization flags from the `CFLAGS` line in the Makefile and
  1119. run `make clean; make` or corresponding.
  1120. To report a bug please open an issue on GitHub, at
  1121. <https://github.com/openssl/openssl/issues>.
  1122. Notes
  1123. =====
  1124. Notes on multi-threading
  1125. ------------------------
  1126. For some systems, the OpenSSL `Configure` script knows what compiler options
  1127. are needed to generate a library that is suitable for multi-threaded
  1128. applications. On these systems, support for multi-threading is enabled
  1129. by default; use the `no-threads` option to disable (this should never be
  1130. necessary).
  1131. On other systems, to enable support for multi-threading, you will have
  1132. to specify at least two options: `threads`, and a system-dependent option.
  1133. (The latter is `-D_REENTRANT` on various systems.) The default in this
  1134. case, obviously, is not to include support for multi-threading (but
  1135. you can still use `no-threads` to suppress an annoying warning message
  1136. from the `Configure` script.)
  1137. OpenSSL provides built-in support for two threading models: pthreads (found on
  1138. most UNIX/Linux systems), and Windows threads. No other threading models are
  1139. supported. If your platform does not provide pthreads or Windows threads then
  1140. you should use `Configure` with the `no-threads` option.
  1141. For pthreads, all locks are non-recursive. In addition, in a debug build,
  1142. the mutex attribute `PTHREAD_MUTEX_ERRORCHECK` is used. If this is not
  1143. available on your platform, you might have to add
  1144. `-DOPENSSL_NO_MUTEX_ERRORCHECK` to your `Configure` invocation.
  1145. (On Linux `PTHREAD_MUTEX_ERRORCHECK` is an enum value, so a built-in
  1146. ifdef test cannot be used.)
  1147. Notes on shared libraries
  1148. -------------------------
  1149. For most systems the OpenSSL `Configure` script knows what is needed to
  1150. build shared libraries for libcrypto and libssl. On these systems
  1151. the shared libraries will be created by default. This can be suppressed and
  1152. only static libraries created by using the `no-shared` option. On systems
  1153. where OpenSSL does not know how to build shared libraries the `no-shared`
  1154. option will be forced and only static libraries will be created.
  1155. Shared libraries are named a little differently on different platforms.
  1156. One way or another, they all have the major OpenSSL version number as
  1157. part of the file name, i.e. for OpenSSL 1.1.x, `1.1` is somehow part of
  1158. the name.
  1159. On most POSIX platforms, shared libraries are named `libcrypto.so.1.1`
  1160. and `libssl.so.1.1`.
  1161. on Cygwin, shared libraries are named `cygcrypto-1.1.dll` and `cygssl-1.1.dll`
  1162. with import libraries `libcrypto.dll.a` and `libssl.dll.a`.
  1163. On Windows build with MSVC or using MingW, shared libraries are named
  1164. `libcrypto-1_1.dll` and `libssl-1_1.dll` for 32-bit Windows,
  1165. `libcrypto-1_1-x64.dll` and `libssl-1_1-x64.dll` for 64-bit x86_64 Windows,
  1166. and `libcrypto-1_1-ia64.dll` and `libssl-1_1-ia64.dll` for IA64 Windows.
  1167. With MSVC, the import libraries are named `libcrypto.lib` and `libssl.lib`,
  1168. while with MingW, they are named `libcrypto.dll.a` and `libssl.dll.a`.
  1169. On VMS, shareable images (VMS speak for shared libraries) are named
  1170. `ossl$libcrypto0101_shr.exe` and `ossl$libssl0101_shr.exe`. However, when
  1171. OpenSSL is specifically built for 32-bit pointers, the shareable images
  1172. are named `ossl$libcrypto0101_shr32.exe` and `ossl$libssl0101_shr32.exe`
  1173. instead, and when built for 64-bit pointers, they are named
  1174. `ossl$libcrypto0101_shr64.exe` and `ossl$libssl0101_shr64.exe`.
  1175. Notes on random number generation
  1176. ---------------------------------
  1177. Availability of cryptographically secure random numbers is required for
  1178. secret key generation. OpenSSL provides several options to seed the
  1179. internal CSPRNG. If not properly seeded, the internal CSPRNG will refuse
  1180. to deliver random bytes and a "PRNG not seeded error" will occur.
  1181. The seeding method can be configured using the `--with-rand-seed` option,
  1182. which can be used to specify a comma separated list of seed methods.
  1183. However, in most cases OpenSSL will choose a suitable default method,
  1184. so it is not necessary to explicitly provide this option. Note also
  1185. that not all methods are available on all platforms. The FIPS provider will
  1186. silently ignore seed sources that were not validated.
  1187. I) On operating systems which provide a suitable randomness source (in
  1188. form of a system call or system device), OpenSSL will use the optimal
  1189. available method to seed the CSPRNG from the operating system's
  1190. randomness sources. This corresponds to the option `--with-rand-seed=os`.
  1191. II) On systems without such a suitable randomness source, automatic seeding
  1192. and reseeding is disabled (`--with-rand-seed=none`) and it may be necessary
  1193. to install additional support software to obtain a random seed and reseed
  1194. the CSPRNG manually. Please check out the manual pages for `RAND_add()`,
  1195. `RAND_bytes()`, `RAND_egd()`, and the FAQ for more information.
  1196. Notes on assembler modules compilation
  1197. --------------------------------------
  1198. Compilation of some code paths in assembler modules might depend on whether the
  1199. current assembler version supports certain ISA extensions or not. Code paths
  1200. that use the AES-NI, PCLMULQDQ, SSSE3, and SHA extensions are always assembled.
  1201. Apart from that, the minimum requirements for the assembler versions are shown
  1202. in the table below:
  1203. | ISA extension | GNU as | nasm | llvm |
  1204. |---------------|--------|--------|---------|
  1205. | AVX | 2.19 | 2.09 | 3.0 |
  1206. | AVX2 | 2.22 | 2.10 | 3.1 |
  1207. | ADCX/ADOX | 2.23 | 2.10 | 3.3 |
  1208. | AVX512 | 2.25 | 2.11.8 | 3.6 (*) |
  1209. | AVX512IFMA | 2.26 | 2.11.8 | 6.0 (*) |
  1210. | VAES | 2.30 | 2.13.3 | 6.0 (*) |
  1211. ---
  1212. (*) Even though AVX512 support was implemented in llvm 3.6, prior to version 7.0
  1213. an explicit -march flag was apparently required to compile assembly modules. But
  1214. then the compiler generates processor-specific code, which in turn contradicts
  1215. the idea of performing dispatch at run-time, which is facilitated by the special
  1216. variable `OPENSSL_ia32cap`. For versions older than 7.0, it is possible to work
  1217. around the problem by forcing the build procedure to use the following script:
  1218. #!/bin/sh
  1219. exec clang -no-integrated-as "$@"
  1220. instead of the real clang. In which case it doesn't matter what clang version
  1221. is used, as it is the version of the GNU assembler that will be checked.
  1222. ---
  1223. <!-- Links -->
  1224. [openssl-users]:
  1225. <https://mta.openssl.org/mailman/listinfo/openssl-users>
  1226. [SUPPORT]:
  1227. ./SUPPORT.md
  1228. [GitHub Issues]:
  1229. <https://github.com/openssl/openssl/issues>
  1230. [raise an issue]:
  1231. <https://github.com/openssl/openssl/issues/new/choose>
  1232. [10-main.conf]:
  1233. Configurations/10-main.conf