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