]> git.ipfire.org Git - thirdparty/openssl.git/blame - INSTALL.md
Make sure we use the libctx when creating an EVP_PKEY_CTX in libssl
[thirdparty/openssl.git] / INSTALL.md
CommitLineData
79e259e3 1
6ede7d73
DMSP
2Build and Install
3=================
4
5This document describes installation on all supported operating
6systems (the Unix/Linux family, including macOS), OpenVMS,
7and Windows).
8
9Table of Contents
10=================
11
12 - [Prerequisites](#prerequisites)
13 - [Notational Conventions](#notational-conventions)
14 - [Quick Installation Guide](#quick-installation-guide)
15 - [Building OpenSSL](#building-openssl)
16 - [Installing OpenSSL](#installing-openssl)
17 - [Configuration Options](#configuration-options)
18 - [API Level](#api-level)
19 - [Cross Compile Prefix](#cross-compile-prefix)
20 - [Build Type](#build-type)
21 - [Directories](#directories)
22 - [Compiler Warnings](#compiler-warnings)
23 - [ZLib Flags](#zlib-flags)
24 - [Seeding the Random Generator](#seeding-the-random-generator)
25 - [Enable and Disable Features](#enable-and-disable-features)
26 - [Displaying configuration data](#displaying-configuration-data)
27 - [Installation Steps in Detail](#installation-steps-in-detail)
28 - [Configure](#configure-openssl)
29 - [Build](#build-openssl)
30 - [Test](#test-openssl)
31 - [Install](#install-openssl)
32 - [Advanced Build Options](#advanced-build-options)
33 - [Environment Variables](#environment-variables)
34 - [Makefile Targets](#makefile-targets)
35 - [Running Selected Tests](#running-selected-tests)
36 - [Troubleshooting](#troubleshooting)
37 - [Configuration Problems](#configuration-problems)
38 - [Build Failures](#build-failures)
39 - [Test Failures](#test-failures)
40 - [Notes](#notes)
41 - [Notes on multi-threading](#notes-on-multi-threading)
42 - [Notes on shared libraries](#notes-on-shared-libraries)
43 - [Notes on random number generation](#notes-on-random-number-generation)
4109b97c 44
79e259e3 45
6ede7d73
DMSP
46Prerequisites
47=============
2acd8ec7 48
6ede7d73 49To install OpenSSL, you will need:
2acd8ec7 50
6ede7d73
DMSP
51 * A make implementation
52 * Perl 5 with core modules (please read [NOTES.PERL](NOTES.PERL))
53 * The Perl module Text::Template (please read [NOTES.PERL](NOTES.PERL))
54 * an ANSI C compiler
55 * a development environment in the form of development libraries and C
56 header files
57 * a supported operating system
79e259e3 58
6ede7d73
DMSP
59For additional platform specific requirements, solutions to specific
60issues and other details, please read one of these:
ea24fe29 61
6ede7d73
DMSP
62 * [NOTES.UNIX](NOTES.UNIX) - notes for Unix like systems
63 * [NOTES.VMS](NOTES.VMS) - notes related to OpenVMS
64 * [NOTES.WIN](NOTES.WIN) - notes related to the Windows platform
65 * [NOTES.DJGPP](NOTES.DJGPP) - building for DOS with DJGPP
66 * [NOTES.ANDROID](NOTES.ANDROID) - building for Android platforms (using NDK)
67 * [NOTES.VALGRIND](NOTES.VALGRIND) - testing with Valgrind
68 * [NOTES.PERL](NOTES.PERL) - some notes on Perl
ea24fe29 69
ea24fe29 70
6ede7d73
DMSP
71Notational conventions
72======================
ea24fe29 73
6ede7d73 74Throughout this document, we use the following conventions.
ea24fe29 75
6ede7d73
DMSP
76Commands
77--------
ea24fe29 78
6ede7d73 79Any line starting with a dollar sign is a command line.
ea24fe29 80
6ede7d73 81 $ command
ea24fe29 82
6ede7d73
DMSP
83The dollar sign indicates the shell prompt and is not to be entered as
84part of the command.
ea24fe29 85
6ede7d73
DMSP
86Choices
87-------
ea24fe29 88
6ede7d73
DMSP
89Several words in curly braces separated by pipe characters indicate a
90**mandatory choice**, to be replaced with one of the given words.
91For example, the line
ea24fe29 92
6ede7d73 93 $ echo { WORD1 | WORD2 | WORD3 }
ea24fe29 94
6ede7d73 95represents one of the following three commands
ea24fe29 96
6ede7d73
DMSP
97 $ echo WORD1
98 - or -
99 $ echo WORD2
100 - or -
101 $ echo WORD3
ea24fe29 102
6ede7d73
DMSP
103One or several words in square brackets separated by pipe characters
104denote an **optional choice**. It is similar to the mandatory choice,
105but it can also be omitted entirely.
79e259e3 106
6ede7d73 107So the line
79e259e3 108
6ede7d73
DMSP
109 $ echo [ WORD1 | WORD2 | WORD3 ]
110
111represents one of the four commands
112
113 $ echo WORD1
114 - or -
115 $ echo WORD2
116 - or -
117 $ echo WORD3
118 - or -
119 $ echo
120
121Arguments
122---------
123
124**Mandatory arguments** are enclosed in double curly braces.
125A simple example would be
126
127 $ type {{ filename }}
128
129which is to be understood to use the command `type` on some file name
130determined by the user.
131
132
133**Optional Arguments** are enclosed in double square brackets.
134
135 [[ options ]]
136
137Note that the notation assumes spaces around {, }, [, ], {{, }} and
138[[, ]]. This is to differentiate from OpenVMS directory
139specifications, which also use [ and ], but without spaces.
140
141
142Quick Installation Guide
143========================
144
145If you just want to get OpenSSL installed without bothering too much
146about the details, here is the short version of how to build and install
147OpenSSL. If any of the following steps fails, please consult the
148[Installation in Detail](#installation-in-detail) section below.
149
150Building OpenSSL
151----------------
152
153Use the following commands to configure, build and test OpenSSL.
154The testing is optional, but recommended if you intend to install
155OpenSSL for production use.
156
157### Unix / Linux / macOS ###
2acd8ec7
RL
158
159 $ ./config
160 $ make
161 $ make test
2acd8ec7 162
6ede7d73
DMSP
163### OpenVMS ###
164
165Use the following commands to build OpenSSL:
2acd8ec7
RL
166
167 $ @config
168 $ mms
169 $ mms test
79e259e3 170
6ede7d73
DMSP
171### Windows ###
172
173If you are using Visual Studio, open a Developer Command Prompt and
174and issue the following commands to build OpenSSL.
b32b8961
RL
175
176 $ perl Configure { VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE }
177 $ nmake
178 $ nmake test
6ede7d73
DMSP
179
180As mentioned in the [Choices](#choices) section, you need to pick one
181of the four Configure targets in the first command.
182
183Most likely you will be using the VC-WIN64A target for 64bit Windows
184binaries (AMD64) or VC-WIN32 for 32bit Windows binaries (X86).
185The other two options are VC_WIN64I (Intel IA64, Itanium) and
186VC-CE (Windows CE) are rather uncommon nowadays.
187
188Installing OpenSSL
189------------------
190
191The following commands will install OpenSSL to a default system location.
192
193**Danger Zone:** even if you are impatient, please read the following two
194paragraphs carefully before you install OpenSSL.
195
196For security reasons the default system location is by default not writable
197for unprivileged users. So for the final installation step administrative
198privileges are required. The default system location and the procedure to
199obtain administrative privileges depends on the operating sytem.
200It is recommended to compile and test OpenSSL with normal user privileges
201and use administrative privileges only for the final installation step.
202
203On some platforms OpenSSL is preinstalled as part of the Operating System.
204In this case it is highly recommended not to overwrite the system versions,
205because other applications or libraries might depend on it.
206To avoid breaking other applications, install your copy of OpenSSL to a
207[different location](#installing-to-a-different-location) which is not in
208the global search path for system libraries.
209
210### Unix / Linux / macOS ###
211
212Depending on your distribution, you need to run the following command as
213root user or prepend `sudo` to the command:
214
215 $ make install
216
217By default, OpenSSL will be installed to
218
219 /usr/local
220
221More precisely, the files will be installed into the subdirectories
222
223 /usr/local/bin
224 /usr/local/lib
225 /usr/local/include
226 ...
227
228depending on the file type, as it is custom on Unix-like operating systems.
229
230### OpenVMS ###
231
232Use the following command to install OpenSSL.
233
234 $ mms install
235
236By default, OpenSSL will be installed to
237
238 SYS$COMMON:[OPENSSL-'version'...]
239
240where 'version' is the OpenSSL version number with underscores instead
241of periods.
242
243### Windows ###
244
245If you are using Visual Studio, open the Developer Command Prompt _elevated_
246and issue the following command.
247
8c16829e 248 $ nmake install
b32b8961 249
6ede7d73
DMSP
250The easiest way to elevate the Command Prompt is to press and hold down
251the both the `<CTRL>` and `<SHIFT>` key while clicking the menu item in the
252task menu.
253
254The default installation location is
255
256 C:\Program Files\OpenSSL
7c03bb9f 257
6ede7d73 258for native binaries, or
b1fe6b43 259
6ede7d73 260 C:\Program Files (x86)\OpenSSL
2acd8ec7 261
6ede7d73 262for 32bit binaries on 64bit Windows (WOW64).
2acd8ec7 263
7c03bb9f 264
6ede7d73 265#### Installing to a different location ####
79e259e3 266
6ede7d73
DMSP
267To install OpenSSL to a different location (for example into your home
268directory for testing purposes) run config like this:
269
270**On Unix**
2acd8ec7
RL
271
272 $ ./config --prefix=/opt/openssl --openssldir=/usr/local/ssl
273
6ede7d73 274**On OpenVMS**
2acd8ec7
RL
275
276 $ @config --prefix=PROGRAM:[INSTALLS] --openssldir=SYS$MANAGER:[OPENSSL]
79e259e3 277
6ede7d73
DMSP
278Note: if you do add options to the configuration command, please make sure
279you've read more than just this Quick Start, such as relevant NOTES.* files,
280the options outline below, as configuration options may change the outcome
281in otherwise unexpected ways.
282
283
284Configuration Options
285=====================
286
287There are several options to ./config (or ./Configure) to customize
288the build (note that for Windows, the defaults for `--prefix` and
289`--openssldir` depend in what configuration is used and what Windows
290implementation OpenSSL is built on. More notes on this in NOTES.WIN):
291
292API Level
293---------
294
295 --api=x.y[.z]
296
297Build the OpenSSL libraries to support the API for the specified version.
298If [no-deprecated](#no-deprecated) is also given, don't build with support
299for deprecated APIs in or below the specified version number. For example,
300addding
301
302 --api=1.1.0 no-deprecated
303
304will remove support for all APIs that were deprecated in OpenSSL version
3051.1.0 or below. This is a rather specialized option for developers.
306If you just intend to remove all deprecated APIs up to the current version
307entirely, just specify [no-deprecated](#no-deprecated).
308If `--api` isn't given, it defaults to the current (minor) OpenSSL version.
309
310
311Cross Compile Prefix
312--------------------
313
314 --cross-compile-prefix=PREFIX
315
316The PREFIX to include in front of commands for your toolchain.
317
318It is likely to have to end with dash, e.g. a-b-c- would invoke GNU compiler as
319a-b-c-gcc, etc. Unfortunately cross-compiling is too case-specific to put
320together one-size-fits-all instructions. You might have to pass more flags or
321set up environment variables to actually make it work. Android and iOS cases are
322discussed in corresponding `Configurations/15-*.conf` files. But there are cases
323when this option alone is sufficient. For example to build the mingw64 target on
324Linux `--cross-compile-prefix=x86_64-w64-mingw32-` works. Naturally provided
325that mingw packages are installed. Today Debian and Ubuntu users have option to
326install a number of prepackaged cross-compilers along with corresponding
327run-time and development packages for "alien" hardware. To give another example
328`--cross-compile-prefix=mipsel-linux-gnu-` suffices in such case. Needless to
329mention that you have to invoke `./Configure`, not `./config`, and pass your target
330name explicitly. Also, note that `--openssldir` refers to target's file system,
331not one you are building on.
332
333
334Build Type
335----------
336
337 --debug
338
339Build OpenSSL with debugging symbols and zero optimization level.
340
341 --release
342
343Build OpenSSL without debugging symbols. This is the default.
344
345
346Directories
347-----------
348
349### libdir ###
350
351 --libdir=DIR
352
353The name of the directory under the top of the installation directory tree
354(see the `--prefix` option) where libraries will be installed. By default
355this is "lib". Note that on Windows only static libraries (`*.lib`) will
356be stored in this location. Shared libraries (`*.dll`) will always be
357installed to the "bin" directory.
358
359### openssldir ###
360
361 --openssldir=DIR
362
363Directory for OpenSSL configuration files, and also the default certificate
364and key store. Defaults are:
365
366 Unix: /usr/local/ssl
367 Windows: C:\Program Files\Common Files\SSL
368 OpenVMS: SYS$COMMON:[OPENSSL-COMMON]
369
370For 32bit Windows applications on Windows 64bit (WOW64), always replace
371`C:\Program Files` by `C:\Program Files (x86)`.
372
373### prefix ###
374
375 --prefix=DIR
376
377The top of the installation directory tree. Defaults are:
378
379 Unix: /usr/local
380 Windows: C:\Program Files\OpenSSL
381 OpenVMS: SYS$COMMON:[OPENSSL-'version']
382
383
384Compiler Warnings
385-----------------
386
387 --strict-warnings
388
389This is a developer flag that switches on various compiler options recommended
390for OpenSSL development. It only works when using gcc or clang as the compiler.
391If you are developing a patch for OpenSSL then it is recommended that you use
392this option where possible.
393
394ZLib Flags
395----------
396
397### with-zlib-include ###
398
399 --with-zlib-include=DIR
400
401The directory for the location of the zlib include file. This option is only
402necessary if [enable-zlib](#enable-zlib) is used and the include file is not
403already on the system include path.
404
405### with-zlib-lib ###
406
407 --with-zlib-lib=LIB
408
409**On Unix**: this is the directory containing the zlib library.
410If not provided the system library path will be used.
411
412**On Windows:** this is the filename of the zlib library (with or
413without a path). This flag must be provided if the
414[zlib-dynamic](#zlib-dynamic) option is not also used. If zlib-dynamic is used
415then this flag is optional and defaults to "ZLIB1" if not provided.
416
417**On VMS:** this is the filename of the zlib library (with or without a path).
418This flag is optional and if not provided then "GNV$LIBZSHR", "GNV$LIBZSHR32"
419or "GNV$LIBZSHR64" is used by default depending on the pointer size chosen.
420
421
422Seeding the Random Generator
423----------------------------
424
425 --with-rand-seed=seed1[,seed2,...]
426
427A comma separated list of seeding methods which will be tried by OpenSSL
428in order to obtain random input (a.k.a "entropy") for seeding its
429cryptographically secure random number generator (CSPRNG).
430The current seeding methods are:
431
432### os ###
433
434Use a trusted operating system entropy source.
435This is the default method if such an entropy source exists.
436
437### getrandom ###
438
439Use the [getrandom(2)][man-getrandom] or equivalent system call.
440
441[man-getrandom]: http://man7.org/linux/man-pages/man2/getrandom.2.html
442
443### devrandom ###
444
445Use the first device from the DEVRANDOM list which can be opened to read
446random bytes. The DEVRANDOM preprocessor constant expands to
447
448 "/dev/urandom","/dev/random","/dev/srandom"
449
450on most unix-ish operating systems.
451
452### egd ###
453
454Check for an entropy generating daemon.
455
456### rdcpu ###
457
458Use the RDSEED or RDRAND command if provided by the CPU.
459
460### librandom ###
461
462Use librandom (not implemented yet).
463
464### none ###
465
466Disable automatic seeding. This is the default on some operating systems where
467no suitable entropy source exists, or no support for it is implemented yet.
468
469For more information, see the section [Notes on random number generation][rng]
470at the end of this document.
471
472[rng]: #notes-on-random-number-generation
473
474
475Enable and Disable Features
476---------------------------
477
478Feature options always come in pairs, an option to enable feature xxxx, and
479and option to disable it:
480
481 [ enable-xxxx | no-xxxx ]
482
483Whether a feature is enabled or disabled by default, depends on the feature.
484In the following list, always the non-default variant is documented: if
485feature xxxx is disabled by default then enable-xxxx is documented and
486if feature xxxx is enabled by default then no-xxxx is documented.
487
488
489### no-afalgeng ###
490
491Don't build the AFALG engine.
492
493This option will be forced on a platform that does not support AFALG.
494
495### enable-ktls ###
496
497Build with Kernel TLS support.
498
499This option will enable the use of the Kernel TLS data-path, which can improve
500performance and allow for the use of sendfile and splice system calls on
501TLS sockets. The Kernel may use TLS accelerators if any are available on the
502system. This option will be forced off on systems that do not support the
503Kernel TLS data-path.
504
505### enable-asan ###
506
507Build with the Address sanitiser.
508
509This is a developer option only. It may not work on all platforms and should
510never be used in production environments. It will only work when used with
511gcc or clang and should be used in conjunction with the [no-shared](#no-shared)
512option.
513
514### no-asm ###
515
516Do not use assembler code.
517
518This should be viewed as debugging/troubleshooting option rather than for
519production use. On some platforms a small amount of assembler code may still
520be used even with this option.
521
522### no-async ###
523
524Do not build support for async operations.
525
526### no-autoalginit ###
527
528Don't automatically load all supported ciphers and digests.
529
530Typically OpenSSL will make available all of its supported ciphers and digests.
531For a statically linked application this may be undesirable if small executable
532size is an objective. This only affects libcrypto. Ciphers and digests will
533have to be loaded manually using EVP_add_cipher() and EVP_add_digest() if this
534option is used. This option will force a non-shared build.
535
536### no-autoerrinit ###
537
538Don't automatically load all libcrypto/libssl error strings.
539
540Typically OpenSSL will automatically load human readable error strings. For a
541statically linked application this may be undesirable if small executable size
542is an objective.
543
544### no-autoload-config ###
545
546Don't automatically load the default openssl.cnf file.
547
548Typically OpenSSL will automatically load a system config file which configures
549default SSL options.
550
551### enable-buildtest-c++ ###
552
553While testing, generate C++ buildtest files that simply check that the public
554OpenSSL header files are usable standalone with C++.
555
556Enabling this option demands extra care. For any compiler flag given directly
557as configuration option, you must ensure that it's valid for both the C and
558the C++ compiler. If not, the C++ build test will most likely break. As an
559alternative, you can use the language specific variables, CFLAGS and CXXFLAGS.
560
561### no-capieng ###
562
563Don't build the CAPI engine.
564
565This option will be forced if on a platform that does not support CAPI.
566
567### no-cmp ###
568
569Don't build support for Certificate Management Protocol (CMP).
570
571### no-cms ###
572
573Don't build support for Cryptographic Message Syntax (CMS).
574
575### no-comp ###
576
577Don't build support for SSL/TLS compression.
578
579If this option is enabled (the default), then compression will only work if
580the zlib or zlib-dynamic options are also chosen.
581
582### enable-crypto-mdebug ###
583
584This now only enables the failed-malloc feature.
585
586### enable-crypto-mdebug-backtrace ###
587
588This is a no-op; the project uses the compiler's address/leak sanitizer instead.
589
590### no-ct ###
591
592Don't build support for Certificate Transparency (CT).
593
594### no-deprecated ###
595
596Don't build with support for deprecated APIs up until and including the version
597given with `--api` (or the current version, if `--api` wasn't specified).
598
599### no-dgram ###
600
601Don't build support for datagram based BIOs.
602
603Selecting this option will also force the disabling of DTLS.
604
605### no-dso ###
606
607Don't build support for loading Dynamic Shared Objects (DSO)
608
609### enable-devcryptoeng ###
610
611Build the `/dev/crypto` engine.
612
613This option is automatically selected on the BSD platform, in which case it can
614be disabled with no-devcryptoeng.
615
616### no-dynamic-engine ###
617
618Don't build the dynamically loaded engines.
619
620This only has an effect in a shared build.
621
622### no-ec ###
623
624Don't build support for Elliptic Curves.
625
626### no-ec2m ###
627
628Don't build support for binary Elliptic Curves
629
630### enable-ec_nistp_64_gcc_128 ###
631
632Enable support for optimised implementations of some commonly used NIST
633elliptic curves.
634
635This option is only supported on platforms:
636
637 - with little-endian storage of non-byte types
638 - that tolerate misaligned memory references
639 - where the compiler:
640 - supports the non-standard type `__uint128_t`
641 - defines the built-in macro `__SIZEOF_INT128__`
642
643### enable-egd ###
644
645Build support for gathering entropy from the Entropy Gathering Daemon (EGD).
646
647### no-engine ###
648
649Don't build support for loading engines.
650
651### no-err ###
652
653Don't compile in any error strings.
654
655### enable-external-tests ###
656
657Enable building of integration with external test suites.
658
659This is a developer option and may not work on all platforms. The following
660external test suites are currently supported:
661
662 - BoringSSL test suite
663 - Python PYCA/Cryptography test suite
664 - krb5 test suite
665
666See the file [test/README.external]/(test/README.external) for further details.
667
668### no-filenames ###
669
670Don't compile in filename and line number information (e.g. for errors and
671memory allocation).
672
673### no-fips ###
674
675Don't compile the FIPS provider
676
677### enable-fuzz-libfuzzer, enable-fuzz-afl ###
678
679Build with support for fuzzing using either libfuzzer or AFL.
680
681These are developer options only. They may not work on all platforms and
682should never be used in production environments.
683
684See the file [fuzz/README.md](fuzz/README.md) for further details.
685
686### no-gost ###
687
688Don't build support for GOST based ciphersuites.
689
690Note that if this feature is enabled then GOST ciphersuites are only available
691if the GOST algorithms are also available through loading an externally supplied
692engine.
693
694### no-legacy ###
695
696Don't build the legacy provider.
697
698Disabling this also disables the legacy algorithms: MD2 (already disabled by default).
699
700
701### no-makedepend ###
702
703Don't generate dependencies.
704
705### no-module ###
79e259e3 706
6ede7d73 707Don't build any dynamically loadable engines.
917a1b2e 708
6ede7d73 709This also implies 'no-dynamic-engine'.
917a1b2e 710
6ede7d73 711### no-multiblock ###
917a1b2e 712
6ede7d73 713Don't build support for writing multiple records in one go in libssl
917a1b2e 714
6ede7d73 715Note: this is a different capability to the pipelining functionality.
917a1b2e 716
6ede7d73 717### no-nextprotoneg ###
917a1b2e 718
6ede7d73 719Don't build support for the Next Protocol Negotiation (NPN) TLS extension.
c9f06e7f 720
6ede7d73 721### no-ocsp ###
c9f06e7f 722
6ede7d73 723Don't build support for Online Certificate Status Protocol (OCSP).
b32b8961 724
2acd8ec7 725
6ede7d73 726### no-padlockeng ###
2acd8ec7 727
6ede7d73 728Don't build the padlock engine.
2acd8ec7 729
6ede7d73 730### no-hw-padlock ###
c9f06e7f 731
6ede7d73 732As synonyme for no-padlockeng. Deprecated and should not be used.
c9f06e7f 733
6ede7d73 734### no-pic ###
b1fe6b43 735
6ede7d73 736Don't build with support for Position Independent Code.
b1fe6b43 737
6ede7d73 738### no-pinshared ###
79e259e3 739
6ede7d73 740Don't pin the shared libraries.
79e259e3 741
6ede7d73
DMSP
742By default OpenSSL will attempt to stay in memory until the process exits.
743This is so that libcrypto and libssl can be properly cleaned up automatically
744via an atexit() handler. The handler is registered by libcrypto and cleans
745up both libraries. On some platforms the atexit() handler will run on unload of
746libcrypto (if it has been dynamically loaded) rather than at process exit. This
747option can be used to stop OpenSSL from attempting to stay in memory until the
748process exits. This could lead to crashes if either libcrypto or libssl have
749already been unloaded at the point that the atexit handler is invoked, e.g. on a
750platform which calls atexit() on unload of the library, and libssl is unloaded
751before libcrypto then a crash is likely to happen. Applications can suppress
752running of the atexit() handler at run time by using the OPENSSL_INIT_NO_ATEXIT
753option to OPENSSL_init_crypto(). See the man page for it for further details.
2acd8ec7 754
6ede7d73 755### no-posix-io ###
2acd8ec7 756
6ede7d73 757Don't use POSIX IO capabilities.
2acd8ec7 758
6ede7d73 759### no-psk ###
79e259e3 760
6ede7d73 761Don't build support for Pre-Shared Key based ciphersuites.
79e259e3 762
6ede7d73 763### no-rdrand ###
79e259e3 764
6ede7d73 765Don't use hardware RDRAND capabilities.
79e259e3 766
6ede7d73 767### no-rfc3779 ###
5bb9e2b4 768
6ede7d73
DMSP
769Don't build support for RFC3779, "X.509 Extensions for IP Addresses and
770AS Identifiers".
79e259e3 771
6ede7d73 772### sctp ###
2acd8ec7 773
6ede7d73 774Build support for Stream Control Transmission Protocol (SCTP).
2acd8ec7 775
6ede7d73 776### no-shared ###
2acd8ec7 777
6ede7d73 778Do not create shared libraries, only static ones.
2acd8ec7 779
2acd8ec7 780
6ede7d73 781See [Notes on shared libraries](#notes-on-shared-libraries) below.
2acd8ec7 782
6ede7d73 783### no-sock ###
2acd8ec7 784
6ede7d73 785Don't build support for socket BIOs.
2acd8ec7 786
6ede7d73 787### no-srp ###
2acd8ec7 788
6ede7d73
DMSP
789Don't build support for Secure Remote Password (SRP) protocol or
790SRP based ciphersuites.
2acd8ec7 791
6ede7d73 792### no-srtp ###
b32b8961 793
6ede7d73 794Don't build Secure Real-Time Transport Protocol (SRTP) support.
b32b8961 795
6ede7d73 796### no-sse2 ###
2acd8ec7 797
6ede7d73 798Exclude SSE2 code paths from 32-bit x86 assembly modules.
79e259e3 799
6ede7d73
DMSP
800Normally SSE2 extension is detected at run-time, but the decision whether or not
801the machine code will be executed is taken solely on CPU capability vector. This
802means that if you happen to run OS kernel which does not support SSE2 extension
803on Intel P4 processor, then your application might be exposed to "illegal
804instruction" exception. There might be a way to enable support in kernel, e.g.
805FreeBSD kernel can be compiled with CPU_ENABLE_SSE, and there is a way to
806disengage SSE2 code paths upon application start-up, but if you aim for wider
807"audience" running such kernel, consider no-sse2. Both the 386 and no-asm
808options imply no-sse2.
79e259e3 809
6ede7d73 810### enable-ssl-trace ###
79e259e3 811
6ede7d73 812Build with the SSL Trace capabilities.
1af66bb7 813
6ede7d73 814This adds the "-trace" option to s_client and s_server.
1af66bb7 815
6ede7d73 816### no-static-engine ###
1af66bb7 817
6ede7d73 818Don't build the statically linked engines.
1af66bb7 819
6ede7d73 820This only has an impact when not built "shared".
1af66bb7 821
6ede7d73 822### no-stdio ###
1af66bb7 823
6ede7d73
DMSP
824Don't use anything from the C header file "stdio.h" that makes use of the "FILE"
825type. Only libcrypto and libssl can be built in this way. Using this option will
826suppress building the command line applications. Additionally, since the OpenSSL
827tests also use the command line applications, the tests will also be skipped.
b1fe6b43 828
6ede7d73 829### no-tests ###
79e259e3 830
6ede7d73 831Don't build test programs or run any tests.
79e259e3 832
6ede7d73 833### no-threads ###
6616429d 834
6ede7d73 835Don't build with support for multi-threaded applications.
2e996acf 836
6ede7d73 837### threads ###
2acd8ec7 838
6ede7d73
DMSP
839Build with support for multi-threaded applications. Most platforms will enable
840this by default. However if on a platform where this is not the case then this
841will usually require additional system-dependent options!
2e996acf 842
6ede7d73 843See [Notes on multi-threading](#notes-on-multi-threading) below.
e3d9a6b5 844
6ede7d73 845### enable-trace ###
b32b8961 846
6ede7d73 847Build with support for the integrated tracing api.
2e996acf 848
6ede7d73 849See manual pages OSSL_trace_set_channel(3) and OSSL_trace_enabled(3) for details.
2e996acf 850
6ede7d73 851### no-ts ###
a73d990e 852
6ede7d73 853Don't build Time Stamping (TS) Authority support.
2e996acf 854
6ede7d73 855### enable-ubsan ###
2e996acf 856
6ede7d73 857Build with the Undefined Behaviour sanitiser (UBSAN).
2e996acf 858
6ede7d73
DMSP
859This is a developer option only. It may not work on all platforms and should
860never be used in production environments. It will only work when used with gcc
861or clang and should be used in conjunction with the `-DPEDANTIC` option
862(or the `--strict-warnings` option).
d40b0622 863
6ede7d73 864### no-ui ###
2e996acf 865
6ede7d73 866Don't build with the User Interface (UI) capability
b1fe6b43 867
6ede7d73 868The User Interface is the set of features enabling text based prompts.
b3e718e2 869
6ede7d73 870### enable-unit-test ###
79e259e3 871
6ede7d73 872Enable additional unit test APIs.
2acd8ec7 873
6ede7d73 874This should not typically be used in production deployments.
7c03bb9f 875
6ede7d73 876### no-uplink ###
2acd8ec7 877
6ede7d73 878Don't build support for UPLINK interface.
2acd8ec7 879
6ede7d73 880### enable-weak-ssl-ciphers ###
b0940b33 881
6ede7d73 882Build support for SSL/TLS ciphers that are considered "weak"
fa28bfd6 883
6ede7d73 884Enabling this includes for example the RC4 based ciphersuites.
fa28bfd6 885
6ede7d73 886### zlib ###
fa28bfd6 887
6ede7d73 888Build with support for zlib compression/decompression.
fa28bfd6 889
6ede7d73 890### zlib-dynamic ###
fa28bfd6 891
6ede7d73
DMSP
892Like the zlib option, but has OpenSSL load the zlib library dynamically
893when needed.
fa28bfd6 894
6ede7d73 895This is only supported on systems where loading of shared libraries is supported.
fa28bfd6 896
6ede7d73 897### 386 ###
fa28bfd6 898
6ede7d73 899In 32-bit x86 builds, use the 80386 instruction set only in assembly modules
fa28bfd6 900
6ede7d73
DMSP
901The default x86 code is more efficient, but requires at least an 486 processor.
902Note: This doesn't affect compiler generated code, so this option needs to be
903accompanied by a corresponding compiler-specific option.
fa28bfd6 904
6ede7d73 905### no-{protocol} ###
bf01fbbf 906
6ede7d73 907 no-{ssl|ssl3|tls|tls1|tls1_1|tls1_2|tls1_3|dtls|dtls1|dtls1_2}
4fd53220 908
6ede7d73 909Don't build support for negotiating the specified SSL/TLS protocol.
b3e718e2 910
6ede7d73
DMSP
911If "no-tls" is selected then all of tls1, tls1_1, tls1_2 and tls1_3 are disabled.
912Similarly "no-dtls" will disable dtls1 and dtls1_2. The "no-ssl" option is
913synonymous with "no-ssl3". Note this only affects version negotiation.
914OpenSSL will still provide the methods for applications to explicitly select
915the individual protocol versions.
b3e718e2 916
6ede7d73 917### no-{protocol}-method ###
b3e718e2 918
6ede7d73 919 no-{ssl|ssl3|tls|tls1|tls1_1|tls1_2|tls1_3|dtls|dtls1|dtls1_2}-method
b3e718e2 920
6ede7d73
DMSP
921Analogous to no-{protocol} but in addition do not build the methods for
922applications to explicitly select individual protocol versions. Note that there
923is no "no-tls1_3-method" option because there is no application method for
924TLSv1.3.
b3e718e2 925
6ede7d73
DMSP
926Using individual protocol methods directly is deprecated. Applications should
927use TLS_method() instead.
b3e718e2 928
6ede7d73 929### enable-{algorithm} ###
b3e718e2 930
6ede7d73 931 enable-{md2|rc5}
b3e718e2 932
6ede7d73 933Build with support for the specified algorithm.
b3e718e2 934
6ede7d73 935### no-{algorithm} ###
b3e718e2 936
6ede7d73
DMSP
937 no-{aria|bf|blake2|camellia|cast|chacha|cmac|
938 des|dh|dsa|ecdh|ecdsa|idea|md4|mdc2|ocb|
939 poly1305|rc2|rc4|rmd160|scrypt|seed|
940 siphash|siv|sm2|sm3|sm4|whirlpool}
d0631327 941
6ede7d73 942Build without support for the specified algorithm.
d0631327 943
6ede7d73 944The "ripemd" algorithm is deprecated and if used is synonymous with rmd160.
d0631327 945
6ede7d73 946### Compiler-specific options ###
d0631327 947
6ede7d73 948 -Dxxx, -Ixxx, -Wp, -lxxx, -Lxxx, -Wl, -rpath, -R, -framework, -static
d0631327 949
6ede7d73
DMSP
950These system specific options will be recognised and passed through to the
951compiler to allow you to define preprocessor symbols, specify additional
952libraries, library directories or other compiler options. It might be worth
953noting that some compilers generate code specifically for processor the
954compiler currently executes on. This is not necessarily what you might have
955in mind, since it might be unsuitable for execution on other, typically older,
956processor. Consult your compiler documentation.
957
958Take note of the [Environment Variables](#environment-variables) documentation
959below and how these flags interact with those variables.
960
961 -xxx, +xxx, /xxx
962
963Additional options that are not otherwise recognised are passed through as
964they are to the compiler as well. Unix-style options beginning with a
965'-' or '+' and Windows-style options beginning with a '/' are recognized.
966Again, consult your compiler documentation.
967
968If the option contains arguments separated by spaces, then the URL-style
969notation %20 can be used for the space character in order to avoid having
970to quote the option. For example, -opt%20arg gets expanded to -opt arg.
971In fact, any ASCII character can be encoded as %xx using its hexadecimal
972encoding.
973
974Take note of the [Environment Variables](#environment-variables) documentation
975below and how these flags interact with those variables.
976
977### Environment Variables ###
978
979 VAR=value
980
981Assign the given value to the environment variable VAR for Configure.
982
983These work just like normal environment variable assignments, but are supported
984on all platforms and are confined to the configuration scripts only.
985These assignments override the corresponding value in the inherited environment,
986if there is one.
987
988The following variables are used as "make variables" and can be used as an
989alternative to giving preprocessor, compiler and linker options directly as
990configuration. The following variables are supported:
991
992 AR The static library archiver.
993 ARFLAGS Flags for the static library archiver.
994 AS The assembler compiler.
995 ASFLAGS Flags for the assembler compiler.
996 CC The C compiler.
997 CFLAGS Flags for the C compiler.
998 CXX The C++ compiler.
999 CXXFLAGS Flags for the C++ compiler.
1000 CPP The C/C++ preprocessor.
1001 CPPFLAGS Flags for the C/C++ preprocessor.
1002 CPPDEFINES List of CPP macro definitions, separated
1003 by a platform specific character (':' or
1004 space for Unix, ';' for Windows, ',' for
1005 VMS). This can be used instead of using
1006 -D (or what corresponds to that on your
1007 compiler) in CPPFLAGS.
1008 CPPINCLUDES List of CPP inclusion directories, separated
1009 the same way as for CPPDEFINES. This can
1010 be used instead of -I (or what corresponds
1011 to that on your compiler) in CPPFLAGS.
1012 HASHBANGPERL Perl invocation to be inserted after '#!'
1013 in public perl scripts (only relevant on
1014 Unix).
1015 LD The program linker (not used on Unix, $(CC)
1016 is used there).
1017 LDFLAGS Flags for the shared library, DSO and
1018 program linker.
1019 LDLIBS Extra libraries to use when linking.
1020 Takes the form of a space separated list
1021 of library specifications on Unix and
1022 Windows, and as a comma separated list of
1023 libraries on VMS.
1024 RANLIB The library archive indexer.
1025 RC The Windows resource compiler.
1026 RCFLAGS Flags for the Windows resource compiler.
1027 RM The command to remove files and directories.
1028
1029These cannot be mixed with compiling/linking flags given on the command line.
1030In other words, something like this isn't permitted.
1031
1032 ./config -DFOO CPPFLAGS=-DBAR -DCOOKIE
1033
1034Backward compatibility note:
1035
1036To be compatible with older configuration scripts, the environment variables
1037are ignored if compiling/linking flags are given on the command line, except
1038for the following:
1039
1040 AR, CC, CXX, CROSS_COMPILE, HASHBANGPERL, PERL, RANLIB, RC, and WINDRES
1041
1042For example, the following command will not see -DBAR:
1043
1044 CPPFLAGS=-DBAR ./config -DCOOKIE
1045
1046However, the following will see both set variables:
1047
1048 CC=gcc CROSS_COMPILE=x86_64-w64-mingw32- ./config -DCOOKIE
1049
1050If CC is set, it is advisable to also set CXX to ensure both the C and C++
1051compiler are in the same "family". This becomes relevant with
1052'enable-external-tests' and 'enable-buildtest-c++'.
1053
1054### Reconfigure ###
1055
1056 reconf
1057 reconfigure
1058
1059Reconfigure from earlier data.
1060
1061This fetches the previous command line options and environment from data saved
1062in "configdata.pm" and runs the configuration process again, using these
1063options and environment. Note: NO other option is permitted together with
1064"reconf". This means that you also MUST use "./Configure" (or what corresponds
1065to that on non-Unix platforms) directly to invoke this option. Note: The
1066original configuration saves away values for ALL environment variables that were
1067used, and if they weren't defined, they are still saved away with information
1068that they weren't originally defined. This information takes precedence over
1069environment variables that are defined when reconfiguring.
1070
1071Displaying configuration data
1072-----------------------------
1073
1074The configuration script itself will say very little, and finishes by
1075creating "configdata.pm". This perl module can be loaded by other scripts
1076to find all the configuration data, and it can also be used as a script to
1077display all sorts of configuration data in a human readable form.
1078
1079For more information, please do:
1080
1081 $ ./configdata.pm --help # Unix
1082
1083or
1084
1085 $ perl configdata.pm --help # Windows and VMS
1086
1087Installation Steps in Detail
1088============================
1089
1090Configure OpenSSL
1091-----------------
1092
1093### Automatic Configuration ###
1094
1095On some platform a `config` script is available which attempts to guess
1096your operating system (and compiler, if necessary) and calls the `Configure`
1097Perl script with appropriate target based on its guess. Further options can
1098be supplied to the `config` script, which will be passed on to the `Configure`
1099script.
1100
1101#### Unix / Linux / macOS ####
1102
1103 $ ./config [[ options ]]
1104
1105#### OpenVMS ####
1106
1107 $ @config [[ options ]]
1108
1109#### Windows ####
1110
1111Automatic configuration is not available on Windows.
1112
1113For the remainder of this text, the Unix form will be used in all examples,
1114please use the appropriate form for your platform.
1115
1116You can run
1117
1118 $ ./config -t
1119
1120to see whether your target is guessed correctly. If you want to use a different
1121compiler, you are cross-compiling for another platform, or the ./config guess
1122was wrong for other reasons, see the [Manual Configuration](#manual-configuration)
1123section. Oherwise continue with the [Build OpenSSL](#build-openssl) section below.
1124
1125On some systems, you can include debugging information as follows:
1126
1127 $ ./config -d [[ options ]]
1128
1129### Manual Configuration ###
1130
1131OpenSSL knows about a range of different operating system, hardware and
1132compiler combinations. To see the ones it knows about, run
1133
1134 $ ./Configure # Unix
1135
1136or
1137
1138 $ perl Configure # All other platforms
1139
1140For the remainder of this text, the Unix form will be used in all examples.
1141Please use the appropriate form for your platform.
1142
1143Pick a suitable name from the list that matches your system. For most
1144operating systems there is a choice between using "cc" or "gcc".
1145When you have identified your system (and if necessary compiler) use this
1146name as the argument to Configure. For example, a "linux-elf" user would
1147run:
1148
1149 $ ./Configure linux-elf [[ options ]]
1150
1151
1152### Creating your own Configuration ###
1153
1154If your system isn't listed, you will have to create a configuration
1155file named Configurations/{{ something }}.conf and add the correct
1156configuration for your system. See the available configs as examples
1157and read Configurations/README and Configurations/README.design for
1158more information.
1159
1160The generic configurations "cc" or "gcc" should usually work on 32 bit
1161Unix-like systems.
1162
1163Configure creates a build file ("Makefile" on Unix, "makefile" on Windows
1164and "descrip.mms" on OpenVMS) from a suitable template in Configurations,
1165and defines various macros in include/openssl/configuration.h (generated
1166from include/openssl/configuration.h.in).
1167
1168### Out of Tree Builds ###
1169
1170OpenSSL can be configured to build in a build directory separate from the
1171source code directory. It's done by placing yourself in some other
1172directory and invoking the configuration commands from there.
1173
1174#### Unix example ####
1175
1176 $ mkdir /var/tmp/openssl-build
1177 $ cd /var/tmp/openssl-build
1178 $ /PATH/TO/OPENSSL/SOURCE/config [[ options ]]
1179
1180or
1181
1182 $ /PATH/TO/OPENSSL/SOURCE/Configure {{ target }} [[ options ]]
1183
1184#### OpenVMS example ####
1185
1186 $ set default sys$login:
1187 $ create/dir [.tmp.openssl-build]
1188 $ set default [.tmp.openssl-build]
1189 $ @[PATH.TO.OPENSSL.SOURCE]config [[ options ]]
1190
1191or
1192
1193 $ @[PATH.TO.OPENSSL.SOURCE]Configure {{ target }} [[ options ]]
1194
1195#### Windows example ####
1196
1197 $ C:
1198 $ mkdir \temp-openssl
1199 $ cd \temp-openssl
1200 $ perl d:\PATH\TO\OPENSSL\SOURCE\Configure {{ target }} [[ options ]]
1201
1202Paths can be relative just as well as absolute. Configure will do its best
1203to translate them to relative paths whenever possible.
1204
1205
1206Build OpenSSL
1207-------------
1208
1209Build OpenSSL by running:
1210
1211 $ make # Unix
1212 $ mms ! (or mmk) OpenVMS
1213 $ nmake # Windows
1214
1215This will build the OpenSSL libraries (libcrypto.a and libssl.a on
1216Unix, corresponding on other platforms) and the OpenSSL binary
1217("openssl"). The libraries will be built in the top-level directory,
1218and the binary will be in the "apps" subdirectory.
1219
1220If the build fails, take a look at the [Build Failures](#build-failures)
1221subsection of the [Troubleshooting](#troubleshooting) section.
1222
1223Test OpenSSL
1224------------
1225
1226After a successful build, and before installing, the libraries should
1227be tested. Run:
1228
1229 $ make test # Unix
1230 $ mms test ! OpenVMS
1231 $ nmake test # Windows
1232
1233**Warning:** you MUST run the tests from an unprivileged account (or disable
1234your privileges temporarily if your platform allows it).
1235
1236If some tests fail, take a look at the [Test Failures](#test-failures)
1237subsection of the [Troubleshooting](#troubleshooting) section.
1238
1239
1240Install OpenSSL
1241---------------
1242
1243If everything tests ok, install OpenSSL with
1244
1245 $ make install # Unix
1246 $ mms install ! OpenVMS
1247 $ nmake install # Windows
1248
1249Note that in order to perform the install step above you need to have
1250appropriate permissions to write to the installation directory.
1251
1252The above commands will install all the software components in this
1253directory tree under PREFIX (the directory given with `--prefix` or
1254its default):
1255
1256#### Unix / Linux / macOS ####
1257
1258 bin/ Contains the openssl binary and a few other
1259 utility scripts.
1260 include/openssl
1261 Contains the header files needed if you want
1262 to build your own programs that use libcrypto
1263 or libssl.
1264 lib Contains the OpenSSL library files.
1265 lib/engines Contains the OpenSSL dynamically loadable engines.
1266
1267 share/man/man1 Contains the OpenSSL command line man-pages.
1268 share/man/man3 Contains the OpenSSL library calls man-pages.
1269 share/man/man5 Contains the OpenSSL configuration format man-pages.
1270 share/man/man7 Contains the OpenSSL other misc man-pages.
1271
1272 share/doc/openssl/html/man1
1273 share/doc/openssl/html/man3
1274 share/doc/openssl/html/man5
1275 share/doc/openssl/html/man7
1276 Contains the HTML rendition of the man-pages.
1277
1278#### OpenVMS ####
1279
1280'arch' is replaced with the architecture name, "Alpha" or "ia64",
1281'sover' is replaced with the shared library version (0101 for 1.1), and
1282'pz' is replaced with the pointer size OpenSSL was built with:
1283
1284 [.EXE.'arch'] Contains the openssl binary.
1285 [.EXE] Contains a few utility scripts.
1286 [.include.openssl]
1287 Contains the header files needed if you want
1288 to build your own programs that use libcrypto
1289 or libssl.
1290 [.LIB.'arch'] Contains the OpenSSL library files.
1291 [.ENGINES'sover''pz'.'arch']
1292 Contains the OpenSSL dynamically loadable engines.
1293 [.SYS$STARTUP] Contains startup, login and shutdown scripts.
1294 These define appropriate logical names and
1295 command symbols.
1296 [.SYSTEST] Contains the installation verification procedure.
1297 [.HTML] Contains the HTML rendition of the manual pages.
1298
1299
1300#### Additional Directories ####
1301
1302Additionally, install will add the following directories under
1303OPENSSLDIR (the directory given with `--openssldir` or its default)
1304for you convenience:
1305
1306 certs Initially empty, this is the default location
1307 for certificate files.
1308 private Initially empty, this is the default location
1309 for private key files.
1310 misc Various scripts.
1311
1312The installation directory should be appropriately protected to ensure
1313unprivileged users cannot make changes to OpenSSL binaries or files, or
1314install engines. If you already have a pre-installed version of OpenSSL as
1315part of your Operating System it is recommended that you do not overwrite
1316the system version and instead install to somewhere else.
1317
1318Package builders who want to configure the library for standard locations,
1319but have the package installed somewhere else so that it can easily be
1320packaged, can use
1321
1322 $ make DESTDIR=/tmp/package-root install # Unix
1323 $ mms/macro="DESTDIR=TMP:[PACKAGE-ROOT]" install ! OpenVMS
1324
1325The specified destination directory will be prepended to all installation
1326target paths.
1327
1328### Compatibility issues with previous OpenSSL versions ###
1329
1330#### COMPILING existing applications ####
1331
1332Starting with version 1.1.0, OpenSSL hides a number of structures that were
1333previously open. This includes all internal libssl structures and a number
1334of EVP types. Accessor functions have been added to allow controlled access
1335to the structures' data.
1336
1337This means that some software needs to be rewritten to adapt to the new ways
1338of doing things. This often amounts to allocating an instance of a structure
1339explicitly where you could previously allocate them on the stack as automatic
1340variables, and using the provided accessor functions where you would previously
1341access a structure's field directly.
1342
1343Some APIs have changed as well. However, older APIs have been preserved when
1344possible.
1345
1346
1347Advanced Build Options
1348======================
1349
1350
1351Environment Variables
1352---------------------
1353
1354A number of environment variables can be used to provide additional control
1355over the build process. Typically these should be defined prior to running
1356config or Configure. Not all environment variables are relevant to all
1357platforms.
1358
1359 AR
1360 The name of the ar executable to use.
1361
1362 BUILDFILE
1363 Use a different build file name than the platform default
1364 ("Makefile" on Unix-like platforms, "makefile" on native Windows,
1365 "descrip.mms" on OpenVMS). This requires that there is a
1366 corresponding build file template. See Configurations/README
1367 for further information.
1368
1369 CC
1370 The compiler to use. Configure will attempt to pick a default
1371 compiler for your platform but this choice can be overridden
1372 using this variable. Set it to the compiler executable you wish
1373 to use, e.g. "gcc" or "clang".
1374
1375 CROSS_COMPILE
1376 This environment variable has the same meaning as for the
1377 "--cross-compile-prefix" Configure flag described above. If both
1378 are set then the Configure flag takes precedence.
1379
1380 NM
1381 The name of the nm executable to use.
1382
1383 OPENSSL_LOCAL_CONFIG_DIR
1384 OpenSSL comes with a database of information about how it
1385 should be built on different platforms as well as build file
1386 templates for those platforms. The database is comprised of
1387 ".conf" files in the Configurations directory. The build
1388 file templates reside there as well as ".tmpl" files. See the
1389 file Configurations/README for further information about the
1390 format of ".conf" files as well as information on the ".tmpl"
1391 files.
1392 In addition to the standard ".conf" and ".tmpl" files, it is
1393 possible to create your own ".conf" and ".tmpl" files and store
1394 them locally, outside the OpenSSL source tree. This environment
1395 variable can be set to the directory where these files are held
1396 and will be considered by Configure before it looks in the
1397 standard directories.
1398
1399 PERL
1400 The name of the Perl executable to use when building OpenSSL.
1401 This variable is used in config script only. Configure on the
1402 other hand imposes the interpreter by which it itself was
1403 executed on the whole build procedure.
1404
1405 HASHBANGPERL
1406 The command string for the Perl executable to insert in the
1407 #! line of perl scripts that will be publicly installed.
1408 Default: /usr/bin/env perl
1409 Note: the value of this variable is added to the same scripts
1410 on all platforms, but it's only relevant on Unix-like platforms.
1411
1412 RC
1413 The name of the rc executable to use. The default will be as
1414 defined for the target platform in the ".conf" file. If not
1415 defined then "windres" will be used. The WINDRES environment
1416 variable is synonymous to this. If both are defined then RC
1417 takes precedence.
1418
1419 RANLIB
1420 The name of the ranlib executable to use.
1421
1422 WINDRES
1423 See RC.
1424
1425
1426Makefile Targets
1427----------------
1428
1429The Configure script generates a Makefile in a format relevant to the specific
1430platform. The Makefiles provide a number of targets that can be used. Not all
1431targets may be available on all platforms. Only the most common targets are
1432described here. Examine the Makefiles themselves for the full list.
1433
1434 all
1435 The target to build all the software components and
1436 documentation.
1437
1438 build_sw
1439 Build all the software components.
1440 THIS IS THE DEFAULT TARGET.
1441
1442 build_docs
1443 Build all documentation components.
1444
1445 clean
1446 Remove all build artefacts and return the directory to a "clean"
1447 state.
1448
1449 depend
1450 Rebuild the dependencies in the Makefiles. This is a legacy
1451 option that no longer needs to be used since OpenSSL 1.1.0.
1452
1453 install
1454 Install all OpenSSL components.
1455
1456 install_sw
1457 Only install the OpenSSL software components.
1458
1459 install_docs
1460 Only install the OpenSSL documentation components.
1461
1462 install_man_docs
1463 Only install the OpenSSL man pages (Unix only).
1464
1465 install_html_docs
1466 Only install the OpenSSL html documentation.
1467
1468 list-tests
1469 Prints a list of all the self test names.
1470
1471 test
1472 Build and run the OpenSSL self tests.
1473
1474 uninstall
1475 Uninstall all OpenSSL components.
1476
1477 reconfigure
1478 reconf
1479 Re-run the configuration process, as exactly as the last time
1480 as possible.
1481
1482 update
1483 This is a developer option. If you are developing a patch for
1484 OpenSSL you may need to use this if you want to update
1485 automatically generated files; add new error codes or add new
1486 (or change the visibility of) public API functions. (Unix only).
1487
1488Running Selected Tests
1489----------------------
1490
1491The make variable TESTS supports a versatile set of space separated tokens
1492with which you can specify a set of tests to be performed. With a "current
1493set of tests" in mind, initially being empty, here are the possible tokens:
1494
1495 alltests The current set of tests becomes the whole set of available
1496 tests (as listed when you do 'make list-tests' or similar).
1497
1498 xxx Adds the test 'xxx' to the current set of tests.
1499
1500 -xxx Removes 'xxx' from the current set of tests. If this is the
1501 first token in the list, the current set of tests is first
1502 assigned the whole set of available tests, effectively making
1503 this token equivalent to TESTS="alltests -xxx".
1504
1505 nn Adds the test group 'nn' (which is a number) to the current
1506 set of tests.
1507
1508 -nn Removes the test group 'nn' from the current set of tests.
1509 If this is the first token in the list, the current set of
1510 tests is first assigned the whole set of available tests,
1511 effectively making this token equivalent to
1512 TESTS="alltests -xxx".
1513
1514Also, all tokens except for "alltests" may have wildcards, such as *.
1515(on Unix and Windows, BSD style wildcards are supported, while on VMS,
1516it's VMS style wildcards)
1517
1518### Examples ###
1519
1520Run all tests except for the fuzz tests:
1521
1522 $ make TESTS=-test_fuzz test
1523
1524or, if you want to be explicit:
1525
1526 $ make TESTS='alltests -test_fuzz' test
1527
1528Run all tests that have a name starting with "test_ssl" but not those
1529starting with "test_ssl_":
1530
1531 $ make TESTS='test_ssl* -test_ssl_*' test
1532
1533Run only test group 10:
1534
1535 $ make TESTS='10'
1536
1537Run all tests except the slow group (group 99):
1538
1539 $ make TESTS='-99'
1540
1541Run all tests in test groups 80 to 99 except for tests in group 90:
1542
1543 $ make TESTS='[89]? -90'
d0631327 1544
5d2f3e4a
P
1545To stochastically verify that the algorithm that produces uniformly distributed
1546random numbers is operating correctly (with a false positive rate of 0.01%):
1547
30a4cda5 1548 $ ./util/wrap.sh test/bntest -stochastic
6ede7d73
DMSP
1549
1550Troubleshooting
1551===============
1552
1553Configuration Problems
1554----------------------
1555
1556### Selecting the correct target ###
1557
1558The `./config` script tries hard to guess your operating system, but in some
1559cases it does not succeed. You will see a message like the following:
1560
1561 $ ./config
1562 Operating system: x86-whatever-minix
1563 This system (minix) is not supported. See file INSTALL for details.
1564
1565Even if the automatic target selection by the `./config` script fails, chances
1566are that you still might find a suitable target in the Configurations directory,
1567which you can supply to the `./Configure` command, possibly after some adjustment.
1568
1569The Configurations directory contains a lot of examples of such targets.
1570The main configuration file is [10-main.conf][], which contains all targets that
1571are officially supported by the OpenSSL team. Other configuration files contain
1572targets contributed by other OpenSSL users. The list of targets can be found in
1573a Perl list `my %targets = ( ... )`.
1574
1575 my %targets = (
1576 ...
1577 "target-name" => {
1578 inherit_from => [ "base-target" ],
1579 CC => "...",
1580 cflags => add("..."),
1581 asm_arch => '...',
1582 perlasm_scheme => "...",
1583 },
1584 ...
1585 )
1586
1587If you call `.\Configure` without arguments, it will give you a list of all
1588known targets. Using `grep`, you can lookup the target definition in the
1589Configurations directory. For example the "android-x86_64" can be found in
1590Configurations/15-android.conf.
1591
1592The directory contains two README files, which explain the general syntax and
1593design of the configurations files.
1594
1595 - [Configurations/README](Configurations/README)
1596 - [Configurations/README.design](Configurations/README.design)
1597
1598If you need further help, try to search the [openssl-users][] mailing list
1599or the [GitHub Issues][] for existing solutions. If you don't find anything,
1600you can [raise an issue][] to ask a question yourself.
1601
1602More about our support resources can be found in the [SUPPORT][] file.
1603
1604### Configuration Errors ###
1605
1606If the `./config` or `./Configure` command fails with an error message,
1607read the error message carefully and try to figure out whether you made
1608a mistake (e.g., by providing a wrong option), or whether the script is
1609working incorrectly. If you think you encountered a bug, please
1610[raise an issue][] on GitHub to file a bug report.
1611
1612Along with a short description of the bug, please provide the complete
1613configure command line and the relevant output including the error message.
1614
1615Note: To make the output readable, pleace add a 'code fence' (three backquotes
1616` ``` ` on a separate line) before and after your output:
1617
1618 ```
1619 $ ./Configure [your arguments...]
1620
1621 [output...]
1622
1623 ```
1624
1625
1626Build Failures
1627--------------
1628
1629If the build fails, look carefully at the output. Try to locate and understand
1630the error message. It might be that the compiler is already telling you
1631exactly what you need to do to fix your problem.
1632
1633There may be reasons for the failure that aren't problems in OpenSSL itself,
1634for example if the compiler reports missing standard or third party headers.
1635
1636If the build succeeded previously, but fails after a source or configuration
1637change, it might be helpful to clean the build tree before attempting another
1638build. Use this command:
1639
1640 $ make clean # Unix
1641 $ mms clean ! (or mmk) OpenVMS
1642 $ nmake clean # Windows
1643
1644Assembler error messages can sometimes be sidestepped by using the
1645"no-asm" configuration option.
1646
1647Compiling parts of OpenSSL with gcc and others with the system compiler will
1648result in unresolved symbols on some systems.
1649
1650If you are still having problems, try to search the [openssl-users][] mailing
1651list or the [GitHub Issues][] for existing solutions. If you think you
1652encountered an OpenSSL bug, please [raise an issue][] to file a bug report.
1653Please take the time to review the existing issues first; maybe the bug was
1654already reported or has already been fixed.
1655
1656
1657Test Failures
1658-------------
1659
1660If some tests fail, look at the output. There may be reasons for the failure
1661that isn't a problem in OpenSSL itself (like a malfunction with Perl).
1662You may want increased verbosity, that can be accomplished like this:
1663
1664Verbosity on failure only (make macro VERBOSE_FAILURE or VF):
1665
1666 $ make VF=1 test # Unix
1667 $ mms /macro=(VF=1) test ! OpenVMS
1668 $ nmake VF=1 test # Windows
1669
1670Full verbosity (make macro VERBOSE or V):
1671
1672 $ make V=1 test # Unix
1673 $ mms /macro=(V=1) test ! OpenVMS
1674 $ nmake V=1 test # Windows
1675
1676If you want to run just one or a few specific tests, you can use
1677the make variable TESTS to specify them, like this:
1678
1679 $ make TESTS='test_rsa test_dsa' test # Unix
1680 $ mms/macro="TESTS=test_rsa test_dsa" test ! OpenVMS
1681 $ nmake TESTS='test_rsa test_dsa' test # Windows
1682
1683And of course, you can combine (Unix example shown):
1684
1685 $ make VF=1 TESTS='test_rsa test_dsa' test
1686
1687You can find the list of available tests like this:
1688
1689 $ make list-tests # Unix
1690 $ mms list-tests ! OpenVMS
1691 $ nmake list-tests # Windows
1692
1693Have a look at the manual for the perl module Test::Harness to
1694see what other HARNESS_* variables there are.
1695
1696If you find a problem with OpenSSL itself, try removing any
1697compiler optimization flags from the CFLAGS line in Makefile and
1698run "make clean; make" or corresponding.
1699
1700To report a bug please open an issue on GitHub, at
1701https://github.com/openssl/openssl/issues.
1702
1703For more details on how the make variables TESTS can be used,
1704see section [Running Selected Tests](#running-selected-tests) below.
1705
1706
1707Notes
1708=====
1709
1710Notes on multi-threading
1711------------------------
1712
1713For some systems, the OpenSSL Configure script knows what compiler options
1714are needed to generate a library that is suitable for multi-threaded
1715applications. On these systems, support for multi-threading is enabled
1716by default; use the "no-threads" option to disable (this should never be
1717necessary).
1718
1719On other systems, to enable support for multi-threading, you will have
1720to specify at least two options: "threads", and a system-dependent option.
1721(The latter is "-D_REENTRANT" on various systems.) The default in this
1722case, obviously, is not to include support for multi-threading (but
1723you can still use "no-threads" to suppress an annoying warning message
1724from the Configure script.)
1725
1726OpenSSL provides built-in support for two threading models: pthreads (found on
1727most UNIX/Linux systems), and Windows threads. No other threading models are
1728supported. If your platform does not provide pthreads or Windows threads then
1729you should Configure with the "no-threads" option.
1730
1731Notes on shared libraries
1732-------------------------
1733
1734For most systems the OpenSSL Configure script knows what is needed to
1735build shared libraries for libcrypto and libssl. On these systems
1736the shared libraries will be created by default. This can be suppressed and
1737only static libraries created by using the "no-shared" option. On systems
1738where OpenSSL does not know how to build shared libraries the "no-shared"
1739option will be forced and only static libraries will be created.
1740
1741Shared libraries are named a little differently on different platforms.
1742One way or another, they all have the major OpenSSL version number as
1743part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of
1744the name.
1745
1746On most POSIX platforms, shared libraries are named libcrypto.so.1.1
1747and libssl.so.1.1.
1748
1749on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll
1750with import libraries libcrypto.dll.a and libssl.dll.a.
1751
1752On Windows build with MSVC or using MingW, shared libraries are named
1753libcrypto-1_1.dll and libssl-1_1.dll for 32-bit Windows, libcrypto-1_1-x64.dll
1754and libssl-1_1-x64.dll for 64-bit x86_64 Windows, and libcrypto-1_1-ia64.dll
1755and libssl-1_1-ia64.dll for IA64 Windows. With MSVC, the import libraries
1756are named libcrypto.lib and libssl.lib, while with MingW, they are named
1757libcrypto.dll.a and libssl.dll.a.
1758
1759On VMS, shareable images (VMS speak for shared libraries) are named
1760ossl$libcrypto0101_shr.exe and ossl$libssl0101_shr.exe. However, when
1761OpenSSL is specifically built for 32-bit pointers, the shareable images
1762are named ossl$libcrypto0101_shr32.exe and ossl$libssl0101_shr32.exe
1763instead, and when built for 64-bit pointers, they are named
1764ossl$libcrypto0101_shr64.exe and ossl$libssl0101_shr64.exe.
1765
1766Notes on random number generation
1767---------------------------------
1768
1769Availability of cryptographically secure random numbers is required for
1770secret key generation. OpenSSL provides several options to seed the
1771internal CSPRNG. If not properly seeded, the internal CSPRNG will refuse
1772to deliver random bytes and a "PRNG not seeded error" will occur.
1773
1774The seeding method can be configured using the `--with-rand-seed` option,
1775which can be used to specify a comma separated list of seed methods.
1776However in most cases OpenSSL will choose a suitable default method,
1777so it is not necessary to explicitly provide this option. Note also
1778that not all methods are available on all platforms.
1779
1780I) On operating systems which provide a suitable randomness source (in
1781form of a system call or system device), OpenSSL will use the optimal
1782available method to seed the CSPRNG from the operating system's
1783randomness sources. This corresponds to the option `--with-rand-seed=os`.
1784
1785II) On systems without such a suitable randomness source, automatic seeding
1786and reseeding is disabled (--with-rand-seed=none) and it may be necessary
1787to install additional support software to obtain a random seed and reseed
1788the CSPRNG manually. Please check out the manual pages for RAND_add(),
1789RAND_bytes(), RAND_egd(), and the FAQ for more information.
1790
1791
1792<!-- Links -->
1793
1794[openssl-users]:
1795 https://mta.openssl.org/mailman/listinfo/openssl-users
1796
1797[SUPPORT]:
1798 ./SUPPORT.md
1799
1800[GitHub Issues]:
1801 https://github.com/openssl/openssl/issues
1802
1803[raise an issue]:
1804 https://github.com/openssl/openssl/issues/new/choose
1805
1806[10-main.conf]:
1807 Configurations/10-main.conf