INSTALL 25 KB

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