]> git.ipfire.org Git - thirdparty/openssl.git/blob - INSTALL
Update the INSTALL instructions with lots of options
[thirdparty/openssl.git] / INSTALL
1
2 OPENSSL INSTALLATION
3 --------------------
4
5 [This document describes installation on the main supported operating
6 systems, currently the Linux/Unix family, OpenVMS and Windows.
7 Installation on DOS (with djgpp), MacOS (before MacOS X)
8 is described in INSTALL.DJGPP or INSTALL.MacOS, respectively.]
9
10 To install OpenSSL, you will need:
11
12 * make
13 * Perl 5 with core modules (please read README.PERL)
14 * The perl module Text::Template (please read README.PERL)
15 * an ANSI C compiler
16 * a development environment in the form of development libraries and C
17 header files
18 * a supported operating system
19
20 For more details regarding specific platforms, there are these notes
21 available:
22
23 * NOTES.VMS (OpenVMS)
24 * NOTES.WIN (any Windows except for Windows CE)
25
26 Quick Start
27 -----------
28
29 If you want to just get on with it, do:
30
31 on Unix:
32
33 $ ./config
34 $ make
35 $ make test
36 $ make install
37
38 on OpenVMS:
39
40 $ @config
41 $ mms
42 $ mms test
43 $ mms install
44
45 on Windows (only pick one of the targets for configuration):
46
47 $ perl Configure { VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE }
48 $ nmake
49 $ nmake test
50 $ nmake install
51
52 [If any of these steps fails, see section Installation in Detail below.]
53
54 This will build and install OpenSSL in the default location, which is:
55
56 Unix: normal installation directories under /usr/local
57 OpenVMS: SYS$COMMON:[OPENSSL-'version'...], where 'version' is the
58 OpenSSL version number with underscores instead of periods.
59 Windows: C:\Program Files\OpenSSL or C:\Program Files (x86)\OpenSSL
60
61 If you want to install it anywhere else, run config like this:
62
63 On Unix:
64
65 $ ./config --prefix=/opt/openssl --openssldir=/usr/local/ssl
66
67 On OpenVMS:
68
69 $ @config --prefix=PROGRAM:[INSTALLS] --openssldir=SYS$MANAGER:[OPENSSL]
70
71
72 Configuration Options
73 ---------------------
74
75 There are several options to ./config (or ./Configure) to customize
76 the build (note that for Windows, the defaults for --prefix and
77 --openssldir depend in what configuration is used and what Windows
78 implementation OpenSSL is built on. More notes on this in NOTES.WIN):
79
80 --prefix=DIR
81 The top of the installation directory tree. Defaults are:
82
83 Unix: /usr/local
84 Windows: C:\Program Files\OpenSSL
85 or C:\Program Files (x86)\OpenSSL
86 OpenVMS: SYS$COMMON:[OPENSSL-'version']
87
88 --openssldir=DIR
89 Directory for OpenSSL configuration files, and also the
90 default certificate and key store. Defaults are:
91
92 Unix: /usr/local/ssl
93 Windows: C:\Program Files\Common Files\SSL
94 or C:\Program Files (x86)\Common Files\SSL
95 OpenVMS: SYS$COMMON:[OPENSSL-COMMON]
96
97 --api=x.y.z
98 Don't build with support for deprecated APIs below the
99 specified version number. For example "--api=1.1.0" will
100 remove support for all APIS that were deprecated in OpenSSL
101 version 1.1.0 or below.
102
103 no-afalgeng
104 Don't build the AFALG engine. This option will be forced if
105 on a platform that does not support AFALG.
106
107 no-asm
108 Do not use assembler code.
109
110 no-async
111 Do not build support for async operations.
112
113 no-autoalginit
114 Don't automatically load all supported ciphers and digests.
115 Typically OpenSSL will make available all of its supported
116 ciphers and digests. For a statically linked application this
117 may be undesirable if small executable size is an objective.
118 This only affects libcrypto. Ciphers and digests will have to
119 be loaded manually using EVP_add_cipher() and
120 EVP_add_digest() if this option is used. This option will
121 force a non-shared build.
122
123 no-autoerrinit
124 Don't automatically load all libcrypto/libssl error strings.
125 Typically OpenSSL will automatically load human readable
126 error strings. For a statically linked application this may
127 be undesirable if small executable size is an objective.
128
129
130 no-capieng
131 Don't build the CAPI engine. This option will be forced if
132 on a platform that does not support CAPI.
133
134 no-cms
135 Don't build support for CMS features
136
137 no-comp
138 Don't build support for SSL/TLS compression. If this option
139 is left enabled (the default), then compression will only
140 work if the zlib or zlib-dynamic options are also chosen.
141
142 enable-crypto-mdebug
143 Build support for debugging memory allocated via
144 OPENSSL_malloc() or OPENSSL_zalloc().
145
146 enable-crypto-mdebug-backtrace
147 As for crypto-mdebug, but additionally provide backtrace
148 information for allocated memory.
149
150 no-ct
151 Don't build support for Certificate Transparency.
152
153 no-deprecated
154 Don't build with support for any deprecated APIs. This is the
155 same as using "--api" and supplying the latest version
156 number.
157
158 no-dgram
159 Don't build support for datagram based BIOs. Selecting this
160 option will also force the disabling of DTLS.
161
162 no-dso
163 Don't build support for loading Dynamic Shared Objects.
164
165 no-dynamic-engine
166 Don't build the dynamically loaded engines. This only has an
167 effect in a "shared" build
168
169 no-ec
170 Don't build support for Elliptic Curves.
171
172 no-ec2m
173 Don't build support for binary Elliptic Curves
174
175 enable-ec_nistp_64_gcc_128
176 Enable support for optimised implementations of some commonly
177 used NIST elliptic curves. This is only supported on some
178 platforms.
179
180 enable-egd
181 Build support for gathering entropy from EGD (Entropy
182 Gathering Daemon).
183
184 no-engine
185 Don't build support for loading engines.
186
187 no-err
188 Don't compile in any error strings.
189
190 no-filenames
191 Don't compile in filename and line number information (e.g.
192 for errors and memory allocation).
193
194 no-gost
195 Don't build support for GOST based ciphersuites. Note that
196 if this feature is enabled then GOST ciphersuites are only
197 available if the GOST algorithms are also available through
198 loading an externally supplied engine.
199
200 enable-heartbeats
201 Build support for DTLS heartbeats.
202
203 no-hw-padlock
204 Don't build the padlock engine.
205
206 no-makedepend
207 ??
208
209 no-multiblock
210 Don't build support for writing multiple records in one
211 go in libssl (Note: this is a different capability to the
212 pipelining functionality).
213
214 no-nextprotoneg
215 Don't build support for the NPN TLS extension.
216
217 no-ocsp
218 Don't build support for OCSP.
219
220 no-pic
221 Don't build with support for Position Independent Code.
222
223 no-posix-io
224 Don't use POSIX IO capabilities.
225
226 no-psk
227 Don't build support for Pre-Shared Key based ciphersuites.
228
229 no-rdrand
230 Don't use hardware RDRAND capabilities.
231
232 no-rfc3779
233 Don't build support for RFC3779 ("X.509 Extensions for IP
234 Addresses and AS Identifiers")
235
236 no-sct
237 ??
238
239 sctp
240 Build support for SCTP
241
242 shared
243 In addition to the usual static libraries, create shared
244 libraries on platforms where it's supported. See "Note on
245 shared libraries" below.
246
247 no-sock
248 Don't build support for socket BIOs
249
250 no-srp
251 Don't build support for SRP or SRP based ciphersuites.
252
253 no-srtp
254 Don't build SRTP support
255
256 no-sse2
257 Exclude SSE2 code paths. Normally SSE2 extension is
258 detected at run-time, but the decision whether or not the
259 machine code will be executed is taken solely on CPU
260 capability vector. This means that if you happen to run OS
261 kernel which does not support SSE2 extension on Intel P4
262 processor, then your application might be exposed to
263 "illegal instruction" exception. There might be a way
264 to enable support in kernel, e.g. FreeBSD kernel can be
265 compiled with CPU_ENABLE_SSE, and there is a way to
266 disengage SSE2 code pathes upon application start-up,
267 but if you aim for wider "audience" running such kernel,
268 consider no-sse2. Both 386 and no-the asm options imply
269 no-sse2.
270
271 enable-ssl-trace
272 Build with the SSL Trace capabilities (adds the "-trace"
273 option to s_client and s_server).
274
275 no-static-engine
276 Don't build the statically linked engines. This only
277 has an impact when not built "shared".
278
279 no-stdio
280 Don't use any C "stdio" features. Only libcrypto and libssl
281 can be built in this way. Using this option will suppress
282 building the command line applications. Additionally since
283 the OpenSSL tests also use the command line applications the
284 tests will also be skipped.
285
286 no-threads
287 Don't try to build with support for multi-threaded
288 applications.
289
290 threads
291 Build with support for multi-threaded applications. Most
292 platforms will enable this by default. However if on a
293 platform where this is not the case then this will usually
294 require additional system-dependent options! See "Note on
295 multi-threading" below.
296
297 no-ts
298 Don't build Time Stamping Authority support.
299
300 no-ui
301 Don't build with the "UI" capability (i.e. the set of
302 features enabling text based prompts).
303
304 enable-unit-test
305 Enable additional unit test APIs. This should not typically
306 be used in production deployments.
307
308 enable-weak-ssl-ciphers
309 Build support for SSL/TLS ciphers that are considered "weak"
310 (e.g. RC4 based ciphersuites).
311
312 zlib
313 Build with support for zlib compression/decompression.
314
315 zlib-dynamic
316 Like "zlib", but has OpenSSL load the zlib library
317 dynamically when needed. This is only supported on systems
318 where loading of shared libraries is supported.
319
320 386
321 On Intel hardware, use the 80386 instruction set only
322 (the default x86 code is more efficient, but requires at
323 least a 486). Note: Use compiler flags for any other CPU
324 specific configuration, e.g. "-m32" to build x86 code on
325 an x64 system.
326
327 no-<prot>
328 Don't build support for negotiating the specified SSL/TLS
329 protocol (one of ssl, ssl3, tls, tls1, tls1_1, tls1_2, dtls,
330 dtls1 or dtls1_2). If "no-tls" is selected then all of tls1,
331 tls1_1 and tls1_2 are disabled. Similarly "no-dtls" will
332 disable dtls1 and dtls1_2. The "no-ssl" option is synonymous
333 with "no-ssl3". Note this only affects version negotiation.
334 OpenSSL will still provide the methods for applications to
335 explicitly select the individual protocol versions.
336
337 no-<prot>-method
338 As for no-<prot> but in addition do not build the methods for
339 applications to explicitly select individual protocol
340 versions.
341
342 enable-<alg>
343 Build with support for the specified algorithm, where <alg>
344 is one of: md2 or rc5.
345
346 no-<alg>
347 Build without support for the specified algorithm, where
348 <alg> is one of: bf, blake2, camellia, cast, chacha, cmac,
349 des, dh, dsa, ecdh, ecdsa, idea, md4, md5, mdc2, ocb,
350 ploy1305, rc2, rc4, rmd160, scrypt, seed or whirlpool. The
351 "ripemd" algorithm is deprecated and if used is synonymous
352 with rmd160.
353
354 -Dxxx, -lxxx, -Lxxx, -fxxx, -mXXX, -Kxxx
355 These system specific options will be passed through to the
356 compiler to allow you to define preprocessor symbols, specify
357 additional libraries, library directories or other compiler
358 options.
359
360
361 Installation in Detail
362 ----------------------
363
364 1a. Configure OpenSSL for your operation system automatically:
365
366 NOTE: This is not available on Windows.
367
368 $ ./config [options] # Unix
369
370 or
371
372 $ @config [options] ! OpenVMS
373
374 For the remainder of this text, the Unix form will be used in all
375 examples, please use the appropriate form for your platform.
376
377 This guesses at your operating system (and compiler, if necessary) and
378 configures OpenSSL based on this guess. Run ./config -t to see
379 if it guessed correctly. If you want to use a different compiler, you
380 are cross-compiling for another platform, or the ./config guess was
381 wrong for other reasons, go to step 1b. Otherwise go to step 2.
382
383 On some systems, you can include debugging information as follows:
384
385 $ ./config -d [options]
386
387 1b. Configure OpenSSL for your operating system manually
388
389 OpenSSL knows about a range of different operating system, hardware and
390 compiler combinations. To see the ones it knows about, run
391
392 $ ./Configure # Unix
393
394 or
395
396 $ perl Configure # All other platforms
397
398 For the remainder of this text, the Unix form will be used in all
399 examples, please use the appropriate form for your platform.
400
401 Pick a suitable name from the list that matches your system. For most
402 operating systems there is a choice between using "cc" or "gcc". When
403 you have identified your system (and if necessary compiler) use this name
404 as the argument to Configure. For example, a "linux-elf" user would
405 run:
406
407 $ ./Configure linux-elf [options]
408
409 If your system isn't listed, you will have to create a configuration
410 file named Configurations/{something}.conf and add the correct
411 configuration for your system. See the available configs as examples
412 and read Configurations/README and Configurations/README.design for
413 more information.
414
415 The generic configurations "cc" or "gcc" should usually work on 32 bit
416 Unix-like systems.
417
418 Configure creates a build file ("Makefile" on Unix and "descrip.mms"
419 on OpenVMS) from a suitable template in Configurations, and
420 defines various macros in crypto/opensslconf.h (generated from
421 crypto/opensslconf.h.in).
422
423 1c. Configure OpenSSL for building outside of the source tree.
424
425 OpenSSL can be configured to build in a build directory separate from
426 the directory with the source code. It's done by placing yourself in
427 some other directory and invoking the configuration commands from
428 there.
429
430 Unix example:
431
432 $ mkdir /var/tmp/openssl-build
433 $ cd /var/tmp/openssl-build
434 $ /PATH/TO/OPENSSL/SOURCE/config [options]
435
436 or
437
438 $ /PATH/TO/OPENSSL/SOURCE/Configure [target] [options]
439
440 OpenVMS example:
441
442 $ set default sys$login:
443 $ create/dir [.tmp.openssl-build]
444 $ set default [.tmp.openssl-build]
445 $ @[PATH.TO.OPENSSL.SOURCE]config {options}
446
447 or
448
449 $ @[PATH.TO.OPENSSL.SOURCE]Configure {target} {options}
450
451 Windows example:
452
453 $ C:
454 $ mkdir \temp-openssl
455 $ cd \temp-openssl
456 $ perl d:\PATH\TO\OPENSSL\SOURCE\Configure {target} {options}
457
458 Paths can be relative just as well as absolute. Configure will
459 do its best to translate them to relative paths whenever possible.
460
461 2. Build OpenSSL by running:
462
463 $ make # Unix
464 $ mms ! (or mmk) OpenVMS
465 $ nmake # Windows
466
467 This will build the OpenSSL libraries (libcrypto.a and libssl.a on
468 Unix, corresponding on other platforms) and the OpenSSL binary
469 ("openssl"). The libraries will be built in the top-level directory,
470 and the binary will be in the "apps" subdirectory.
471
472 If the build fails, look at the output. There may be reasons for
473 the failure that aren't problems in OpenSSL itself (like missing
474 standard headers). If it is a problem with OpenSSL itself, please
475 report the problem to <rt@openssl.org> (note that your message
476 will be recorded in the request tracker publicly readable at
477 https://www.openssl.org/community/index.html#bugs and will be
478 forwarded to a public mailing list). Please check out the request
479 tracker. Maybe the bug was already reported or has already been
480 fixed.
481
482 [If you encounter assembler error messages, try the "no-asm"
483 configuration option as an immediate fix.]
484
485 Compiling parts of OpenSSL with gcc and others with the system
486 compiler will result in unresolved symbols on some systems.
487
488 3. After a successful build, the libraries should be tested. Run:
489
490 $ make test # Unix
491 $ mms test ! OpenVMS
492 $ nmake test # Windows
493
494 If some tests fail, look at the output. There may be reasons for
495 the failure that isn't a problem in OpenSSL itself (like a
496 malfunction with Perl). You may want increased verbosity, that
497 can be accomplished like this:
498
499 $ HARNESS_VERBOSE=yes make test # Unix
500
501 $ DEFINE HARNESS_VERBOSE YES
502 $ mms test ! OpenVMS
503
504 $ set HARNESS_VERBOSE=yes
505 $ nmake test # Windows
506
507 If you want to run just one or a few specific tests, you can use
508 the make variable TESTS to specify them, like this:
509
510 $ make TESTS='test_rsa test_dsa' test # Unix
511 $ mms/macro="TESTS=test_rsa test_dsa" test ! OpenVMS
512 $ nmake TESTS='test_rsa test_dsa' test # Windows
513
514 And of course, you can combine (Unix example shown):
515
516 $ HARNESS_VERBOSE=yes make TESTS='test_rsa test_dsa' test
517
518 You can find the list of available tests like this:
519
520 $ make list-tests # Unix
521 $ mms list-tests ! OpenVMS
522 $ nmake list-tests # Windows
523
524 Have a look at the manual for the perl module Test::Harness to
525 see what other HARNESS_* variables there are.
526
527 If you find a problem with OpenSSL itself, try removing any
528 compiler optimization flags from the CFLAGS line in Makefile and
529 run "make clean; make" or corresponding.
530
531 Please send a bug reports to <rt@openssl.org>.
532
533 4. If everything tests ok, install OpenSSL with
534
535 $ make install # Unix
536 $ mms install ! OpenVMS
537
538 This will install all the software components in this directory
539 tree under PREFIX (the directory given with --prefix or its
540 default):
541
542 Unix:
543
544 bin/ Contains the openssl binary and a few other
545 utility scripts.
546 include/openssl
547 Contains the header files needed if you want
548 to build your own programs that use libcrypto
549 or libssl.
550 lib Contains the OpenSSL library files.
551 lib/engines Contains the OpenSSL dynamically loadable engines.
552 share/man/{man1,man3,man5,man7}
553 Contains the OpenSSL man-pages.
554 share/doc/openssl/html/{man1,man3,man5,man7}
555 Contains the HTML rendition of the man-pages.
556
557 OpenVMS ('arch' is replaced with the architecture name, "Alpha"
558 or "ia64"):
559
560 [.EXE.'arch'] Contains the openssl binary and a few other
561 utility scripts.
562 [.include.openssl]
563 Contains the header files needed if you want
564 to build your own programs that use libcrypto
565 or libssl.
566 [.LIB.'arch'] Contains the OpenSSL library files.
567 [.ENGINES.'arch']
568 Contains the OpenSSL dynamically loadable engines.
569 [.SYS$STARTUP] Contains startup, login and shutdown scripts.
570 These define appropriate logical names and
571 command symbols.
572
573
574 Additionally, install will add the following directories under
575 OPENSSLDIR (the directory given with --openssldir or its default)
576 for you convenience:
577
578 certs Initially empty, this is the default location
579 for certificate files.
580 private Initially empty, this is the default location
581 for private key files.
582 misc Various scripts.
583
584 Package builders who want to configure the library for standard
585 locations, but have the package installed somewhere else so that
586 it can easily be packaged, can use
587
588 $ make DESTDIR=/tmp/package-root install # Unix
589 $ mms/macro="DESTDIR=TMP:[PACKAGE-ROOT]" install ! OpenVMS
590
591 The specified destination directory will be prepended to all
592 installation target paths.
593
594 Compatibility issues with previous OpenSSL versions:
595
596 * COMPILING existing applications
597
598 OpenSSL 1.1 hides a number of structures that were previously
599 open. This includes all internal libssl structures and a number
600 of EVP types. Accessor functions have been added to allow
601 controlled access to the structures' data.
602
603 This means that some software needs to be rewritten to adapt to
604 the new ways of doing things. This often amounts to allocating
605 an instance of a structure explicitly where you could previously
606 allocate them on the stack as automatic variables, and using the
607 provided accessor functions where you would previously access a
608 structure's field directly.
609
610 <TBA>
611
612 Some APIs have changed as well. However, older APIs have been
613 preserved when possible.
614
615
616 Note on multi-threading
617 -----------------------
618
619 For some systems, the OpenSSL Configure script knows what compiler options
620 are needed to generate a library that is suitable for multi-threaded
621 applications. On these systems, support for multi-threading is enabled
622 by default; use the "no-threads" option to disable (this should never be
623 necessary).
624
625 On other systems, to enable support for multi-threading, you will have
626 to specify at least two options: "threads", and a system-dependent option.
627 (The latter is "-D_REENTRANT" on various systems.) The default in this
628 case, obviously, is not to include support for multi-threading (but
629 you can still use "no-threads" to suppress an annoying warning message
630 from the Configure script.)
631
632 OpenSSL provides built-in support for two threading models: pthreads (found on
633 most UNIX/Linux systems), and Windows threads. No other threading models are
634 supported. If your platform does not provide pthreads or Windows threads then
635 you should Configure with the "no-threads" option.
636
637 Note on shared libraries
638 ------------------------
639
640 Shared libraries have certain caveats. Binary backward compatibility
641 can't be guaranteed before OpenSSL version 1.0. The only reason to
642 use them would be to conserve memory on systems where several programs
643 are using OpenSSL.
644
645 For most systems, the OpenSSL Configure script knows what is needed to
646 build shared libraries for libcrypto and libssl. On these systems,
647 the shared libraries are currently not created by default, but giving
648 the option "shared" will get them created.
649
650 Note on random number generation
651 --------------------------------
652
653 Availability of cryptographically secure random numbers is required for
654 secret key generation. OpenSSL provides several options to seed the
655 internal PRNG. If not properly seeded, the internal PRNG will refuse
656 to deliver random bytes and a "PRNG not seeded error" will occur.
657 On systems without /dev/urandom (or similar) device, it may be necessary
658 to install additional support software to obtain random seed.
659 Please check out the manual pages for RAND_add(), RAND_bytes(), RAND_egd(),
660 and the FAQ for more information.
661