INSTALL 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249
  1. OPENSSL INSTALLATION
  2. --------------------
  3. This document describes installation on all supported operating
  4. systems (the Unix/Linux family (which includes Mac OS/X), OpenVMS,
  5. and 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, solutions to specific
  15. issues and other details, please read one of these:
  16. * NOTES.UNIX (any supported Unix like system)
  17. * NOTES.VMS (OpenVMS)
  18. * NOTES.WIN (any supported Windows)
  19. * NOTES.DJGPP (DOS platform with DJGPP)
  20. * NOTES.ANDROID (obviously Android [NDK])
  21. Notational conventions in this document
  22. ---------------------------------------
  23. Throughout this document, we use the following conventions in command
  24. examples:
  25. $ command Any line starting with a dollar sign
  26. ($) is a command line.
  27. { word1 | word2 | word3 } This denotes a mandatory choice, to be
  28. replaced with one of the given words.
  29. A simple example would be this:
  30. $ echo { FOO | BAR | COOKIE }
  31. which is to be understood as one of
  32. these:
  33. $ echo FOO
  34. - or -
  35. $ echo BAR
  36. - or -
  37. $ echo COOKIE
  38. [ word1 | word2 | word3 ] Similar to { word1 | word2 | word3 }
  39. except it's optional to give any of
  40. those. In addition to the examples
  41. above, this would also be valid:
  42. $ echo
  43. {{ target }} This denotes a mandatory word or
  44. sequence of words of some sort. A
  45. simple example would be this:
  46. $ type {{ filename }}
  47. which is to be understood to use the
  48. command 'type' on some file name
  49. determined by the user.
  50. [[ options ]] Similar to {{ target }}, but is
  51. optional.
  52. Note that the notation assumes spaces around {, }, [, ], {{, }} and
  53. [[, ]]. This is to differentiate from OpenVMS directory
  54. specifications, which also use [ and ], but without spaces.
  55. Quick Start
  56. -----------
  57. If you want to just get on with it, do:
  58. on Unix (again, this includes Mac OS/X):
  59. $ ./config
  60. $ make
  61. $ make test
  62. $ make install
  63. on OpenVMS:
  64. $ @config
  65. $ mms
  66. $ mms test
  67. $ mms install
  68. on Windows (only pick one of the targets for configuration):
  69. $ perl Configure { VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE }
  70. $ nmake
  71. $ nmake test
  72. $ nmake install
  73. If any of these steps fails, see section Installation in Detail below.
  74. This will build and install OpenSSL in the default location, which is:
  75. Unix: normal installation directories under /usr/local
  76. OpenVMS: SYS$COMMON:[OPENSSL-'version'...], where 'version' is the
  77. OpenSSL version number with underscores instead of periods.
  78. Windows: C:\Program Files\OpenSSL or C:\Program Files (x86)\OpenSSL
  79. If you want to install it anywhere else, run config like this:
  80. On Unix:
  81. $ ./config --prefix=/opt/openssl --openssldir=/usr/local/ssl
  82. On OpenVMS:
  83. $ @config --prefix=PROGRAM:[INSTALLS] --openssldir=SYS$MANAGER:[OPENSSL]
  84. (Note: if you do add options to the configuration command, please make sure
  85. you've read more than just this Quick Start, such as relevant NOTES.* files,
  86. the options outline below, as configuration options may change the outcome
  87. in otherwise unexpected ways)
  88. Configuration Options
  89. ---------------------
  90. There are several options to ./config (or ./Configure) to customize
  91. the build (note that for Windows, the defaults for --prefix and
  92. --openssldir depend in what configuration is used and what Windows
  93. implementation OpenSSL is built on. More notes on this in NOTES.WIN):
  94. --api=x.y.z
  95. Don't build with support for deprecated APIs below the
  96. specified version number. For example "--api=1.1.0" will
  97. remove support for all APIS that were deprecated in OpenSSL
  98. version 1.1.0 or below.
  99. --cross-compile-prefix=PREFIX
  100. The PREFIX to include in front of commands for your
  101. toolchain. It's likely to have to end with dash, e.g.
  102. a-b-c- would invoke GNU compiler as a-b-c-gcc, etc.
  103. Unfortunately cross-compiling is too case-specific to
  104. put together one-size-fits-all instructions. You might
  105. have to pass more flags or set up environment variables
  106. to actually make it work. Android and iOS cases are
  107. discussed in corresponding Configurations/15-*.conf
  108. files. But there are cases when this option alone is
  109. sufficient. For example to build the mingw64 target on
  110. Linux "--cross-compile-prefix=x86_64-w64-mingw32-"
  111. works. Naturally provided that mingw packages are
  112. installed. Today Debian and Ubuntu users have option to
  113. install a number of prepackaged cross-compilers along
  114. with corresponding run-time and development packages for
  115. "alien" hardware. To give another example
  116. "--cross-compile-prefix=mipsel-linux-gnu-" suffices
  117. in such case. Needless to mention that you have to
  118. invoke ./Configure, not ./config, and pass your target
  119. name explicitly. Also, note that --openssldir refers
  120. to target's file system, not one you are building on.
  121. --debug
  122. Build OpenSSL with debugging symbols and zero optimization
  123. level.
  124. --libdir=DIR
  125. The name of the directory under the top of the installation
  126. directory tree (see the --prefix option) where libraries will
  127. be installed. By default this is "lib". Note that on Windows
  128. only ".lib" files will be stored in this location. dll files
  129. will always be installed to the "bin" directory.
  130. --openssldir=DIR
  131. Directory for OpenSSL configuration files, and also the
  132. default certificate and key store. Defaults are:
  133. Unix: /usr/local/ssl
  134. Windows: C:\Program Files\Common Files\SSL
  135. or C:\Program Files (x86)\Common Files\SSL
  136. OpenVMS: SYS$COMMON:[OPENSSL-COMMON]
  137. --prefix=DIR
  138. The top of the installation directory tree. Defaults are:
  139. Unix: /usr/local
  140. Windows: C:\Program Files\OpenSSL
  141. or C:\Program Files (x86)\OpenSSL
  142. OpenVMS: SYS$COMMON:[OPENSSL-'version']
  143. --release
  144. Build OpenSSL without debugging symbols. This is the default.
  145. --strict-warnings
  146. This is a developer flag that switches on various compiler
  147. options recommended for OpenSSL development. It only works
  148. when using gcc or clang as the compiler. If you are
  149. developing a patch for OpenSSL then it is recommended that
  150. you use this option where possible.
  151. --with-zlib-include=DIR
  152. The directory for the location of the zlib include file. This
  153. option is only necessary if enable-zlib (see below) is used
  154. and the include file is not already on the system include
  155. path.
  156. --with-zlib-lib=LIB
  157. On Unix: this is the directory containing the zlib library.
  158. If not provided the system library path will be used.
  159. On Windows: this is the filename of the zlib library (with or
  160. without a path). This flag must be provided if the
  161. zlib-dynamic option is not also used. If zlib-dynamic is used
  162. then this flag is optional and a default value ("ZLIB1") is
  163. used if not provided.
  164. On VMS: this is the filename of the zlib library (with or
  165. without a path). This flag is optional and if not provided
  166. then "GNV$LIBZSHR", "GNV$LIBZSHR32" or "GNV$LIBZSHR64" is
  167. used by default depending on the pointer size chosen.
  168. --with-rand-seed=seed1[,seed2,...]
  169. A comma separated list of seeding methods which will be tried
  170. by OpenSSL in order to obtain random input (a.k.a "entropy")
  171. for seeding its cryptographically secure random number
  172. generator (CSPRNG). The current seeding methods are:
  173. os: Use a trusted operating system entropy source.
  174. This is the default method if such an entropy
  175. source exists.
  176. getrandom: Use the L<getrandom(2)> or equivalent system
  177. call.
  178. devrandom: Use the the first device from the DEVRANDOM list
  179. which can be opened to read random bytes. The
  180. DEVRANDOM preprocessor constant expands to
  181. "/dev/urandom","/dev/random","/dev/srandom" on
  182. most unix-ish operating systems.
  183. egd: Check for an entropy generating daemon.
  184. rdcpu: Use the RDSEED or RDRAND command if provided by
  185. the CPU.
  186. librandom: Use librandom (not implemented yet).
  187. none: Disable automatic seeding. This is the default
  188. on some operating systems where no suitable
  189. entropy source exists, or no support for it is
  190. implemented yet.
  191. For more information, see the section 'Note on random number
  192. generation' at the end of this document.
  193. no-afalgeng
  194. Don't build the AFALG engine. This option will be forced if
  195. on a platform that does not support AFALG.
  196. enable-ktls
  197. Build with Kernel TLS support. This option will enable the
  198. use of the Kernel TLS data-path, which can improve
  199. performance and allow for the use of sendfile and splice
  200. system calls on TLS sockets. The Kernel may use TLS
  201. accelerators if any are available on the system.
  202. This option will be forced off on systems that do not support
  203. the Kernel TLS data-path.
  204. enable-asan
  205. Build with the Address sanitiser. This is a developer option
  206. only. It may not work on all platforms and should never be
  207. used in production environments. It will only work when used
  208. with gcc or clang and should be used in conjunction with the
  209. no-shared option.
  210. no-asm
  211. Do not use assembler code. This should be viewed as
  212. debugging/trouble-shooting option rather than production.
  213. On some platforms a small amount of assembler code may
  214. still be used even with this option.
  215. no-async
  216. Do not build support for async operations.
  217. no-autoalginit
  218. Don't automatically load all supported ciphers and digests.
  219. Typically OpenSSL will make available all of its supported
  220. ciphers and digests. For a statically linked application this
  221. may be undesirable if small executable size is an objective.
  222. This only affects libcrypto. Ciphers and digests will have to
  223. be loaded manually using EVP_add_cipher() and
  224. EVP_add_digest() if this option is used. This option will
  225. force a non-shared build.
  226. no-autoerrinit
  227. Don't automatically load all libcrypto/libssl error strings.
  228. Typically OpenSSL will automatically load human readable
  229. error strings. For a statically linked application this may
  230. be undesirable if small executable size is an objective.
  231. no-autoload-config
  232. Don't automatically load the default openssl.cnf file.
  233. Typically OpenSSL will automatically load a system config
  234. file which configures default ssl options.
  235. no-capieng
  236. Don't build the CAPI engine. This option will be forced if
  237. on a platform that does not support CAPI.
  238. no-cms
  239. Don't build support for CMS features
  240. no-comp
  241. Don't build support for SSL/TLS compression. If this option
  242. is left enabled (the default), then compression will only
  243. work if the zlib or zlib-dynamic options are also chosen.
  244. enable-crypto-mdebug
  245. Build support for debugging memory allocated via
  246. OPENSSL_malloc() or OPENSSL_zalloc().
  247. enable-crypto-mdebug-backtrace
  248. As for crypto-mdebug, but additionally provide backtrace
  249. information for allocated memory.
  250. TO BE USED WITH CARE: this uses GNU C functionality, and
  251. is therefore not usable for non-GNU config targets. If
  252. your build complains about the use of '-rdynamic' or the
  253. lack of header file execinfo.h, this option is not for you.
  254. ALSO NOTE that even though execinfo.h is available on your
  255. system (through Gnulib), the functions might just be stubs
  256. that do nothing.
  257. no-ct
  258. Don't build support for Certificate Transparency.
  259. no-deprecated
  260. Don't build with support for any deprecated APIs. This is the
  261. same as using "--api" and supplying the latest version
  262. number.
  263. no-dgram
  264. Don't build support for datagram based BIOs. Selecting this
  265. option will also force the disabling of DTLS.
  266. enable-devcryptoeng
  267. Build the /dev/crypto engine. It is automatically selected
  268. on BSD implementations, in which case it can be disabled with
  269. no-devcryptoeng.
  270. no-dso
  271. Don't build support for loading Dynamic Shared Objects.
  272. no-dynamic-engine
  273. Don't build the dynamically loaded engines. This only has an
  274. effect in a "shared" build
  275. no-ec
  276. Don't build support for Elliptic Curves.
  277. no-ec2m
  278. Don't build support for binary Elliptic Curves
  279. enable-ec_nistp_64_gcc_128
  280. Enable support for optimised implementations of some commonly
  281. used NIST elliptic curves.
  282. This is only supported on platforms:
  283. - with little-endian storage of non-byte types
  284. - that tolerate misaligned memory references
  285. - where the compiler:
  286. - supports the non-standard type __uint128_t
  287. - defines the built-in macro __SIZEOF_INT128__
  288. enable-egd
  289. Build support for gathering entropy from EGD (Entropy
  290. Gathering Daemon).
  291. no-engine
  292. Don't build support for loading engines.
  293. no-err
  294. Don't compile in any error strings.
  295. enable-external-tests
  296. Enable building of integration with external test suites.
  297. This is a developer option and may not work on all platforms.
  298. The only supported external test suite at the current time is
  299. the BoringSSL test suite. See the file test/README.external
  300. for further details.
  301. no-filenames
  302. Don't compile in filename and line number information (e.g.
  303. for errors and memory allocation).
  304. enable-fuzz-libfuzzer, enable-fuzz-afl
  305. Build with support for fuzzing using either libfuzzer or AFL.
  306. These are developer options only. They may not work on all
  307. platforms and should never be used in production environments.
  308. See the file fuzz/README.md for further details.
  309. no-gost
  310. Don't build support for GOST based ciphersuites. Note that
  311. if this feature is enabled then GOST ciphersuites are only
  312. available if the GOST algorithms are also available through
  313. loading an externally supplied engine.
  314. no-hw-padlock
  315. Don't build the padlock engine.
  316. no-makedepend
  317. Don't generate dependencies.
  318. no-multiblock
  319. Don't build support for writing multiple records in one
  320. go in libssl (Note: this is a different capability to the
  321. pipelining functionality).
  322. no-nextprotoneg
  323. Don't build support for the NPN TLS extension.
  324. no-ocsp
  325. Don't build support for OCSP.
  326. no-pic
  327. Don't build with support for Position Independent Code.
  328. no-pinshared By default OpenSSL will attempt to stay in memory until the
  329. process exits. This is so that libcrypto and libssl can be
  330. properly cleaned up automatically via an "atexit()" handler.
  331. The handler is registered by libcrypto and cleans up both
  332. libraries. On some platforms the atexit() handler will run on
  333. unload of libcrypto (if it has been dynamically loaded)
  334. rather than at process exit. This option can be used to stop
  335. OpenSSL from attempting to stay in memory until the process
  336. exits. This could lead to crashes if either libcrypto or
  337. libssl have already been unloaded at the point
  338. that the atexit handler is invoked, e.g. on a platform which
  339. calls atexit() on unload of the library, and libssl is
  340. unloaded before libcrypto then a crash is likely to happen.
  341. Applications can suppress running of the atexit() handler at
  342. run time by using the OPENSSL_INIT_NO_ATEXIT option to
  343. OPENSSL_init_crypto(). See the man page for it for further
  344. details.
  345. no-posix-io
  346. Don't use POSIX IO capabilities.
  347. no-psk
  348. Don't build support for Pre-Shared Key based ciphersuites.
  349. no-rdrand
  350. Don't use hardware RDRAND capabilities.
  351. no-rfc3779
  352. Don't build support for RFC3779 ("X.509 Extensions for IP
  353. Addresses and AS Identifiers")
  354. sctp
  355. Build support for SCTP
  356. no-shared
  357. Do not create shared libraries, only static ones. See "Note
  358. on shared libraries" below.
  359. no-sock
  360. Don't build support for socket BIOs
  361. no-srp
  362. Don't build support for SRP or SRP based ciphersuites.
  363. no-srtp
  364. Don't build SRTP support
  365. no-sse2
  366. Exclude SSE2 code paths from 32-bit x86 assembly modules.
  367. Normally SSE2 extension is detected at run-time, but the
  368. decision whether or not the machine code will be executed
  369. is taken solely on CPU capability vector. This means that
  370. if you happen to run OS kernel which does not support SSE2
  371. extension on Intel P4 processor, then your application
  372. might be exposed to "illegal instruction" exception.
  373. There might be a way to enable support in kernel, e.g.
  374. FreeBSD kernel can be compiled with CPU_ENABLE_SSE, and
  375. there is a way to disengage SSE2 code paths upon application
  376. start-up, but if you aim for wider "audience" running
  377. such kernel, consider no-sse2. Both the 386 and
  378. no-asm options imply no-sse2.
  379. enable-ssl-trace
  380. Build with the SSL Trace capabilities (adds the "-trace"
  381. option to s_client and s_server).
  382. no-static-engine
  383. Don't build the statically linked engines. This only
  384. has an impact when not built "shared".
  385. no-stdio
  386. Don't use anything from the C header file "stdio.h" that
  387. makes use of the "FILE" type. Only libcrypto and libssl can
  388. be built in this way. Using this option will suppress
  389. building the command line applications. Additionally since
  390. the OpenSSL tests also use the command line applications the
  391. tests will also be skipped.
  392. no-tests
  393. Don't build test programs or run any test.
  394. no-threads
  395. Don't try to build with support for multi-threaded
  396. applications.
  397. threads
  398. Build with support for multi-threaded applications. Most
  399. platforms will enable this by default. However if on a
  400. platform where this is not the case then this will usually
  401. require additional system-dependent options! See "Note on
  402. multi-threading" below.
  403. no-ts
  404. Don't build Time Stamping Authority support.
  405. enable-ubsan
  406. Build with the Undefined Behaviour sanitiser. This is a
  407. developer option only. It may not work on all platforms and
  408. should never be used in production environments. It will only
  409. work when used with gcc or clang and should be used in
  410. conjunction with the "-DPEDANTIC" option (or the
  411. --strict-warnings option).
  412. no-ui
  413. Don't build with the "UI" capability (i.e. the set of
  414. features enabling text based prompts).
  415. enable-unit-test
  416. Enable additional unit test APIs. This should not typically
  417. be used in production deployments.
  418. enable-weak-ssl-ciphers
  419. Build support for SSL/TLS ciphers that are considered "weak"
  420. (e.g. RC4 based ciphersuites).
  421. zlib
  422. Build with support for zlib compression/decompression.
  423. zlib-dynamic
  424. Like "zlib", but has OpenSSL load the zlib library
  425. dynamically when needed. This is only supported on systems
  426. where loading of shared libraries is supported.
  427. 386
  428. In 32-bit x86 builds, when generating assembly modules,
  429. use the 80386 instruction set only (the default x86 code
  430. is more efficient, but requires at least a 486). Note:
  431. This doesn't affect code generated by compiler, you're
  432. likely to complement configuration command line with
  433. suitable compiler-specific option.
  434. no-<prot>
  435. Don't build support for negotiating the specified SSL/TLS
  436. protocol (one of ssl, ssl3, tls, tls1, tls1_1, tls1_2,
  437. tls1_3, dtls, dtls1 or dtls1_2). If "no-tls" is selected then
  438. all of tls1, tls1_1, tls1_2 and tls1_3 are disabled.
  439. Similarly "no-dtls" will disable dtls1 and dtls1_2. The
  440. "no-ssl" option is synonymous with "no-ssl3". Note this only
  441. affects version negotiation. OpenSSL will still provide the
  442. methods for applications to explicitly select the individual
  443. protocol versions.
  444. no-<prot>-method
  445. As for no-<prot> but in addition do not build the methods for
  446. applications to explicitly select individual protocol
  447. versions. Note that there is no "no-tls1_3-method" option
  448. because there is no application method for TLSv1.3. Using
  449. individual protocol methods directly is deprecated.
  450. Applications should use TLS_method() instead.
  451. enable-<alg>
  452. Build with support for the specified algorithm, where <alg>
  453. is one of: md2 or rc5.
  454. no-<alg>
  455. Build without support for the specified algorithm, where
  456. <alg> is one of: aria, bf, blake2, camellia, cast, chacha,
  457. cmac, des, dh, dsa, ecdh, ecdsa, idea, md4, mdc2, ocb,
  458. poly1305, rc2, rc4, rmd160, scrypt, seed, siphash, siv, sm2,
  459. sm3, sm4 or whirlpool. The "ripemd" algorithm is deprecated
  460. and if used is synonymous with rmd160.
  461. -Dxxx, -Ixxx, -Wp, -lxxx, -Lxxx, -Wl, -rpath, -R, -framework, -static
  462. These system specific options will be recognised and
  463. passed through to the compiler to allow you to define
  464. preprocessor symbols, specify additional libraries, library
  465. directories or other compiler options. It might be worth
  466. noting that some compilers generate code specifically for
  467. processor the compiler currently executes on. This is not
  468. necessarily what you might have in mind, since it might be
  469. unsuitable for execution on other, typically older,
  470. processor. Consult your compiler documentation.
  471. Take note of the VAR=value documentation below and how
  472. these flags interact with those variables.
  473. -xxx, +xxx
  474. Additional options that are not otherwise recognised are
  475. passed through as they are to the compiler as well. Again,
  476. consult your compiler documentation.
  477. Take note of the VAR=value documentation below and how
  478. these flags interact with those variables.
  479. VAR=value
  480. Assignment of environment variable for Configure. These
  481. work just like normal environment variable assignments,
  482. but are supported on all platforms and are confined to
  483. the configuration scripts only. These assignments override
  484. the corresponding value in the inherited environment, if
  485. there is one.
  486. The following variables are used as "make variables" and
  487. can be used as an alternative to giving preprocessor,
  488. compiler and linker options directly as configuration.
  489. The following variables are supported:
  490. AR The static library archiver.
  491. ARFLAGS Flags for the static library archiver.
  492. AS The assembler compiler.
  493. ASFLAGS Flags for the assembler compiler.
  494. CC The C compiler.
  495. CFLAGS Flags for the C compiler.
  496. CXX The C++ compiler.
  497. CXXFLAGS Flags for the C++ compiler.
  498. CPP The C/C++ preprocessor.
  499. CPPFLAGS Flags for the C/C++ preprocessor.
  500. CPPDEFINES List of CPP macro definitions, separated
  501. by a platform specific character (':' or
  502. space for Unix, ';' for Windows, ',' for
  503. VMS). This can be used instead of using
  504. -D (or what corresponds to that on your
  505. compiler) in CPPFLAGS.
  506. CPPINCLUDES List of CPP inclusion directories, separated
  507. the same way as for CPPDEFINES. This can
  508. be used instead of -I (or what corresponds
  509. to that on your compiler) in CPPFLAGS.
  510. HASHBANGPERL Perl invocation to be inserted after '#!'
  511. in public perl scripts (only relevant on
  512. Unix).
  513. LD The program linker (not used on Unix, $(CC)
  514. is used there).
  515. LDFLAGS Flags for the shared library, DSO and
  516. program linker.
  517. LDLIBS Extra libraries to use when linking.
  518. Takes the form of a space separated list
  519. of library specifications on Unix and
  520. Windows, and as a comma separated list of
  521. libraries on VMS.
  522. RANLIB The library archive indexer.
  523. RC The Windows resource compiler.
  524. RCFLAGS Flags for the Windows resource compiler.
  525. RM The command to remove files and directories.
  526. These cannot be mixed with compiling / linking flags given
  527. on the command line. In other words, something like this
  528. isn't permitted.
  529. ./config -DFOO CPPFLAGS=-DBAR -DCOOKIE
  530. Backward compatibility note:
  531. To be compatible with older configuration scripts, the
  532. environment variables are ignored if compiling / linking
  533. flags are given on the command line, except for these:
  534. AR, CC, CXX, CROSS_COMPILE, HASHBANGPERL, PERL, RANLIB, RC
  535. and WINDRES
  536. For example, the following command will not see -DBAR:
  537. CPPFLAGS=-DBAR ./config -DCOOKIE
  538. However, the following will see both set variables:
  539. CC=gcc CROSS_COMPILE=x86_64-w64-mingw32- \
  540. ./config -DCOOKIE
  541. reconf
  542. reconfigure
  543. Reconfigure from earlier data. This fetches the previous
  544. command line options and environment from data saved in
  545. "configdata.pm", and runs the configuration process again,
  546. using these options and environment.
  547. Note: NO other option is permitted together with "reconf".
  548. This means that you also MUST use "./Configure" (or
  549. what corresponds to that on non-Unix platforms) directly
  550. to invoke this option.
  551. Note: The original configuration saves away values for ALL
  552. environment variables that were used, and if they weren't
  553. defined, they are still saved away with information that
  554. they weren't originally defined. This information takes
  555. precedence over environment variables that are defined
  556. when reconfiguring.
  557. Displaying configuration data
  558. -----------------------------
  559. The configuration script itself will say very little, and finishes by
  560. creating "configdata.pm". This perl module can be loaded by other scripts
  561. to find all the configuration data, and it can also be used as a script to
  562. display all sorts of configuration data in a human readable form.
  563. For more information, please do:
  564. $ ./configdata.pm --help # Unix
  565. or
  566. $ perl configdata.pm --help # Windows and VMS
  567. Installation in Detail
  568. ----------------------
  569. 1a. Configure OpenSSL for your operation system automatically:
  570. NOTE: This is not available on Windows.
  571. $ ./config [[ options ]] # Unix
  572. or
  573. $ @config [[ options ]] ! OpenVMS
  574. For the remainder of this text, the Unix form will be used in all
  575. examples, please use the appropriate form for your platform.
  576. This guesses at your operating system (and compiler, if necessary) and
  577. configures OpenSSL based on this guess. Run ./config -t to see
  578. if it guessed correctly. If you want to use a different compiler, you
  579. are cross-compiling for another platform, or the ./config guess was
  580. wrong for other reasons, go to step 1b. Otherwise go to step 2.
  581. On some systems, you can include debugging information as follows:
  582. $ ./config -d [[ options ]]
  583. 1b. Configure OpenSSL for your operating system manually
  584. OpenSSL knows about a range of different operating system, hardware and
  585. compiler combinations. To see the ones it knows about, run
  586. $ ./Configure # Unix
  587. or
  588. $ perl Configure # All other platforms
  589. For the remainder of this text, the Unix form will be used in all
  590. examples, please use the appropriate form for your platform.
  591. Pick a suitable name from the list that matches your system. For most
  592. operating systems there is a choice between using "cc" or "gcc". When
  593. you have identified your system (and if necessary compiler) use this name
  594. as the argument to Configure. For example, a "linux-elf" user would
  595. run:
  596. $ ./Configure linux-elf [[ options ]]
  597. If your system isn't listed, you will have to create a configuration
  598. file named Configurations/{{ something }}.conf and add the correct
  599. configuration for your system. See the available configs as examples
  600. and read Configurations/README and Configurations/README.design for
  601. more information.
  602. The generic configurations "cc" or "gcc" should usually work on 32 bit
  603. Unix-like systems.
  604. Configure creates a build file ("Makefile" on Unix, "makefile" on Windows
  605. and "descrip.mms" on OpenVMS) from a suitable template in Configurations,
  606. and defines various macros in include/openssl/opensslconf.h (generated from
  607. include/openssl/opensslconf.h.in).
  608. 1c. Configure OpenSSL for building outside of the source tree.
  609. OpenSSL can be configured to build in a build directory separate from
  610. the directory with the source code. It's done by placing yourself in
  611. some other directory and invoking the configuration commands from
  612. there.
  613. Unix example:
  614. $ mkdir /var/tmp/openssl-build
  615. $ cd /var/tmp/openssl-build
  616. $ /PATH/TO/OPENSSL/SOURCE/config [[ options ]]
  617. or
  618. $ /PATH/TO/OPENSSL/SOURCE/Configure {{ target }} [[ options ]]
  619. OpenVMS example:
  620. $ set default sys$login:
  621. $ create/dir [.tmp.openssl-build]
  622. $ set default [.tmp.openssl-build]
  623. $ @[PATH.TO.OPENSSL.SOURCE]config [[ options ]]
  624. or
  625. $ @[PATH.TO.OPENSSL.SOURCE]Configure {{ target }} [[ options ]]
  626. Windows example:
  627. $ C:
  628. $ mkdir \temp-openssl
  629. $ cd \temp-openssl
  630. $ perl d:\PATH\TO\OPENSSL\SOURCE\Configure {{ target }} [[ options ]]
  631. Paths can be relative just as well as absolute. Configure will
  632. do its best to translate them to relative paths whenever possible.
  633. 2. Build OpenSSL by running:
  634. $ make # Unix
  635. $ mms ! (or mmk) OpenVMS
  636. $ nmake # Windows
  637. This will build the OpenSSL libraries (libcrypto.a and libssl.a on
  638. Unix, corresponding on other platforms) and the OpenSSL binary
  639. ("openssl"). The libraries will be built in the top-level directory,
  640. and the binary will be in the "apps" subdirectory.
  641. Troubleshooting:
  642. If the build fails, look at the output. There may be reasons
  643. for the failure that aren't problems in OpenSSL itself (like
  644. missing standard headers).
  645. If the build succeeded previously, but fails after a source or
  646. configuration change, it might be helpful to clean the build tree
  647. before attempting another build. Use this command:
  648. $ make clean # Unix
  649. $ mms clean ! (or mmk) OpenVMS
  650. $ nmake clean # Windows
  651. Assembler error messages can sometimes be sidestepped by using the
  652. "no-asm" configuration option.
  653. Compiling parts of OpenSSL with gcc and others with the system
  654. compiler will result in unresolved symbols on some systems.
  655. If you are still having problems you can get help by sending an email
  656. to the openssl-users email list (see
  657. https://www.openssl.org/community/mailinglists.html for details). If
  658. it is a bug with OpenSSL itself, please open an issue on GitHub, at
  659. https://github.com/openssl/openssl/issues. Please review the existing
  660. ones first; maybe the bug was already reported or has already been
  661. fixed.
  662. 3. After a successful build, the libraries should be tested. Run:
  663. $ make test # Unix
  664. $ mms test ! OpenVMS
  665. $ nmake test # Windows
  666. NOTE: you MUST run the tests from an unprivileged account (or
  667. disable your privileges temporarily if your platform allows it).
  668. If some tests fail, look at the output. There may be reasons for
  669. the failure that isn't a problem in OpenSSL itself (like a
  670. malfunction with Perl). You may want increased verbosity, that
  671. can be accomplished like this:
  672. $ make VERBOSE=1 test # Unix
  673. $ mms /macro=(VERBOSE=1) test ! OpenVMS
  674. $ nmake VERBOSE=1 test # Windows
  675. If you want to run just one or a few specific tests, you can use
  676. the make variable TESTS to specify them, like this:
  677. $ make TESTS='test_rsa test_dsa' test # Unix
  678. $ mms/macro="TESTS=test_rsa test_dsa" test ! OpenVMS
  679. $ nmake TESTS='test_rsa test_dsa' test # Windows
  680. And of course, you can combine (Unix example shown):
  681. $ make VERBOSE=1 TESTS='test_rsa test_dsa' test
  682. You can find the list of available tests like this:
  683. $ make list-tests # Unix
  684. $ mms list-tests ! OpenVMS
  685. $ nmake list-tests # Windows
  686. Have a look at the manual for the perl module Test::Harness to
  687. see what other HARNESS_* variables there are.
  688. If you find a problem with OpenSSL itself, try removing any
  689. compiler optimization flags from the CFLAGS line in Makefile and
  690. run "make clean; make" or corresponding.
  691. To report a bug please open an issue on GitHub, at
  692. https://github.com/openssl/openssl/issues.
  693. For more details on how the make variables TESTS can be used,
  694. see section TESTS in Detail below.
  695. 4. If everything tests ok, install OpenSSL with
  696. $ make install # Unix
  697. $ mms install ! OpenVMS
  698. $ nmake install # Windows
  699. This will install all the software components in this directory
  700. tree under PREFIX (the directory given with --prefix or its
  701. default):
  702. Unix:
  703. bin/ Contains the openssl binary and a few other
  704. utility scripts.
  705. include/openssl
  706. Contains the header files needed if you want
  707. to build your own programs that use libcrypto
  708. or libssl.
  709. lib Contains the OpenSSL library files.
  710. lib/engines Contains the OpenSSL dynamically loadable engines.
  711. share/man/man1 Contains the OpenSSL command line man-pages.
  712. share/man/man3 Contains the OpenSSL library calls man-pages.
  713. share/man/man5 Contains the OpenSSL configuration format man-pages.
  714. share/man/man7 Contains the OpenSSL other misc man-pages.
  715. share/doc/openssl/html/man1
  716. share/doc/openssl/html/man3
  717. share/doc/openssl/html/man5
  718. share/doc/openssl/html/man7
  719. Contains the HTML rendition of the man-pages.
  720. OpenVMS ('arch' is replaced with the architecture name, "Alpha"
  721. or "ia64", 'sover' is replaced with the shared library version
  722. (0101 for 1.1), and 'pz' is replaced with the pointer size
  723. OpenSSL was built with):
  724. [.EXE.'arch'] Contains the openssl binary.
  725. [.EXE] Contains a few utility scripts.
  726. [.include.openssl]
  727. Contains the header files needed if you want
  728. to build your own programs that use libcrypto
  729. or libssl.
  730. [.LIB.'arch'] Contains the OpenSSL library files.
  731. [.ENGINES'sover''pz'.'arch']
  732. Contains the OpenSSL dynamically loadable engines.
  733. [.SYS$STARTUP] Contains startup, login and shutdown scripts.
  734. These define appropriate logical names and
  735. command symbols.
  736. [.SYSTEST] Contains the installation verification procedure.
  737. [.HTML] Contains the HTML rendition of the manual pages.
  738. Additionally, install will add the following directories under
  739. OPENSSLDIR (the directory given with --openssldir or its default)
  740. for you convenience:
  741. certs Initially empty, this is the default location
  742. for certificate files.
  743. private Initially empty, this is the default location
  744. for private key files.
  745. misc Various scripts.
  746. Package builders who want to configure the library for standard
  747. locations, but have the package installed somewhere else so that
  748. it can easily be packaged, can use
  749. $ make DESTDIR=/tmp/package-root install # Unix
  750. $ mms/macro="DESTDIR=TMP:[PACKAGE-ROOT]" install ! OpenVMS
  751. The specified destination directory will be prepended to all
  752. installation target paths.
  753. Compatibility issues with previous OpenSSL versions:
  754. * COMPILING existing applications
  755. Starting with version 1.1.0, OpenSSL hides a number of structures
  756. that were previously open. This includes all internal libssl
  757. structures and a number of EVP types. Accessor functions have
  758. been added to allow controlled access to the structures' data.
  759. This means that some software needs to be rewritten to adapt to
  760. the new ways of doing things. This often amounts to allocating
  761. an instance of a structure explicitly where you could previously
  762. allocate them on the stack as automatic variables, and using the
  763. provided accessor functions where you would previously access a
  764. structure's field directly.
  765. Some APIs have changed as well. However, older APIs have been
  766. preserved when possible.
  767. Environment Variables
  768. ---------------------
  769. A number of environment variables can be used to provide additional control
  770. over the build process. Typically these should be defined prior to running
  771. config or Configure. Not all environment variables are relevant to all
  772. platforms.
  773. AR
  774. The name of the ar executable to use.
  775. BUILDFILE
  776. Use a different build file name than the platform default
  777. ("Makefile" on Unix-like platforms, "makefile" on native Windows,
  778. "descrip.mms" on OpenVMS). This requires that there is a
  779. corresponding build file template. See Configurations/README
  780. for further information.
  781. CC
  782. The compiler to use. Configure will attempt to pick a default
  783. compiler for your platform but this choice can be overridden
  784. using this variable. Set it to the compiler executable you wish
  785. to use, e.g. "gcc" or "clang".
  786. CROSS_COMPILE
  787. This environment variable has the same meaning as for the
  788. "--cross-compile-prefix" Configure flag described above. If both
  789. are set then the Configure flag takes precedence.
  790. NM
  791. The name of the nm executable to use.
  792. OPENSSL_LOCAL_CONFIG_DIR
  793. OpenSSL comes with a database of information about how it
  794. should be built on different platforms as well as build file
  795. templates for those platforms. The database is comprised of
  796. ".conf" files in the Configurations directory. The build
  797. file templates reside there as well as ".tmpl" files. See the
  798. file Configurations/README for further information about the
  799. format of ".conf" files as well as information on the ".tmpl"
  800. files.
  801. In addition to the standard ".conf" and ".tmpl" files, it is
  802. possible to create your own ".conf" and ".tmpl" files and store
  803. them locally, outside the OpenSSL source tree. This environment
  804. variable can be set to the directory where these files are held
  805. and will be considered by Configure before it looks in the
  806. standard directories.
  807. PERL
  808. The name of the Perl executable to use when building OpenSSL.
  809. This variable is used in config script only. Configure on the
  810. other hand imposes the interpreter by which it itself was
  811. executed on the whole build procedure.
  812. HASHBANGPERL
  813. The command string for the Perl executable to insert in the
  814. #! line of perl scripts that will be publically installed.
  815. Default: /usr/bin/env perl
  816. Note: the value of this variable is added to the same scripts
  817. on all platforms, but it's only relevant on Unix-like platforms.
  818. RC
  819. The name of the rc executable to use. The default will be as
  820. defined for the target platform in the ".conf" file. If not
  821. defined then "windres" will be used. The WINDRES environment
  822. variable is synonymous to this. If both are defined then RC
  823. takes precedence.
  824. RANLIB
  825. The name of the ranlib executable to use.
  826. WINDRES
  827. See RC.
  828. Makefile targets
  829. ----------------
  830. The Configure script generates a Makefile in a format relevant to the specific
  831. platform. The Makefiles provide a number of targets that can be used. Not all
  832. targets may be available on all platforms. Only the most common targets are
  833. described here. Examine the Makefiles themselves for the full list.
  834. all
  835. The default target to build all the software components.
  836. clean
  837. Remove all build artefacts and return the directory to a "clean"
  838. state.
  839. depend
  840. Rebuild the dependencies in the Makefiles. This is a legacy
  841. option that no longer needs to be used since OpenSSL 1.1.0.
  842. install
  843. Install all OpenSSL components.
  844. install_sw
  845. Only install the OpenSSL software components.
  846. install_docs
  847. Only install the OpenSSL documentation components.
  848. install_man_docs
  849. Only install the OpenSSL man pages (Unix only).
  850. install_html_docs
  851. Only install the OpenSSL html documentation.
  852. list-tests
  853. Prints a list of all the self test names.
  854. test
  855. Build and run the OpenSSL self tests.
  856. uninstall
  857. Uninstall all OpenSSL components.
  858. reconfigure
  859. reconf
  860. Re-run the configuration process, as exactly as the last time
  861. as possible.
  862. update
  863. This is a developer option. If you are developing a patch for
  864. OpenSSL you may need to use this if you want to update
  865. automatically generated files; add new error codes or add new
  866. (or change the visibility of) public API functions. (Unix only).
  867. TESTS in Detail
  868. ---------------
  869. The make variable TESTS supports a versatile set of space separated tokens
  870. with which you can specify a set of tests to be performed. With a "current
  871. set of tests" in mind, initially being empty, here are the possible tokens:
  872. alltests The current set of tests becomes the whole set of available
  873. tests (as listed when you do 'make list-tests' or similar).
  874. xxx Adds the test 'xxx' to the current set of tests.
  875. -xxx Removes 'xxx' from the current set of tests. If this is the
  876. first token in the list, the current set of tests is first
  877. assigned the whole set of available tests, effectively making
  878. this token equivalent to TESTS="alltests -xxx".
  879. nn Adds the test group 'nn' (which is a number) to the current
  880. set of tests.
  881. -nn Removes the test group 'nn' from the current set of tests.
  882. If this is the first token in the list, the current set of
  883. tests is first assigned the whole set of available tests,
  884. effectively making this token equivalent to
  885. TESTS="alltests -xxx".
  886. Also, all tokens except for "alltests" may have wildcards, such as *.
  887. (on Unix and Windows, BSD style wildcards are supported, while on VMS,
  888. it's VMS style wildcards)
  889. Example: All tests except for the fuzz tests:
  890. $ make TESTS=-test_fuzz test
  891. or (if you want to be explicit)
  892. $ make TESTS='alltests -test_fuzz' test
  893. Example: All tests that have a name starting with "test_ssl" but not those
  894. starting with "test_ssl_":
  895. $ make TESTS='test_ssl* -test_ssl_*' test
  896. Example: Only test group 10:
  897. $ make TESTS='10'
  898. Example: All tests except the slow group (group 99):
  899. $ make TESTS='-99'
  900. Example: All tests in test groups 80 to 99 except for tests in group 90:
  901. $ make TESTS='[89]? -90'
  902. Note on multi-threading
  903. -----------------------
  904. For some systems, the OpenSSL Configure script knows what compiler options
  905. are needed to generate a library that is suitable for multi-threaded
  906. applications. On these systems, support for multi-threading is enabled
  907. by default; use the "no-threads" option to disable (this should never be
  908. necessary).
  909. On other systems, to enable support for multi-threading, you will have
  910. to specify at least two options: "threads", and a system-dependent option.
  911. (The latter is "-D_REENTRANT" on various systems.) The default in this
  912. case, obviously, is not to include support for multi-threading (but
  913. you can still use "no-threads" to suppress an annoying warning message
  914. from the Configure script.)
  915. OpenSSL provides built-in support for two threading models: pthreads (found on
  916. most UNIX/Linux systems), and Windows threads. No other threading models are
  917. supported. If your platform does not provide pthreads or Windows threads then
  918. you should Configure with the "no-threads" option.
  919. Notes on shared libraries
  920. -------------------------
  921. For most systems the OpenSSL Configure script knows what is needed to
  922. build shared libraries for libcrypto and libssl. On these systems
  923. the shared libraries will be created by default. This can be suppressed and
  924. only static libraries created by using the "no-shared" option. On systems
  925. where OpenSSL does not know how to build shared libraries the "no-shared"
  926. option will be forced and only static libraries will be created.
  927. Shared libraries are named a little differently on different platforms.
  928. One way or another, they all have the major OpenSSL version number as
  929. part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of
  930. the name.
  931. On most POSIX platforms, shared libraries are named libcrypto.so.1.1
  932. and libssl.so.1.1.
  933. on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll
  934. with import libraries libcrypto.dll.a and libssl.dll.a.
  935. On Windows build with MSVC or using MingW, shared libraries are named
  936. libcrypto-1_1.dll and libssl-1_1.dll for 32-bit Windows, libcrypto-1_1-x64.dll
  937. and libssl-1_1-x64.dll for 64-bit x86_64 Windows, and libcrypto-1_1-ia64.dll
  938. and libssl-1_1-ia64.dll for IA64 Windows. With MSVC, the import libraries
  939. are named libcrypto.lib and libssl.lib, while with MingW, they are named
  940. libcrypto.dll.a and libssl.dll.a.
  941. On VMS, shareable images (VMS speak for shared libraries) are named
  942. ossl$libcrypto0101_shr.exe and ossl$libssl0101_shr.exe. However, when
  943. OpenSSL is specifically built for 32-bit pointers, the shareable images
  944. are named ossl$libcrypto0101_shr32.exe and ossl$libssl0101_shr32.exe
  945. instead, and when built for 64-bit pointers, they are named
  946. ossl$libcrypto0101_shr64.exe and ossl$libssl0101_shr64.exe.
  947. Note on random number generation
  948. --------------------------------
  949. Availability of cryptographically secure random numbers is required for
  950. secret key generation. OpenSSL provides several options to seed the
  951. internal CSPRNG. If not properly seeded, the internal CSPRNG will refuse
  952. to deliver random bytes and a "PRNG not seeded error" will occur.
  953. The seeding method can be configured using the --with-rand-seed option,
  954. which can be used to specify a comma separated list of seed methods.
  955. However in most cases OpenSSL will choose a suitable default method,
  956. so it is not necessary to explicitly provide this option. Note also
  957. that not all methods are available on all platforms.
  958. I) On operating systems which provide a suitable randomness source (in
  959. form of a system call or system device), OpenSSL will use the optimal
  960. available method to seed the CSPRNG from the operating system's
  961. randomness sources. This corresponds to the option --with-rand-seed=os.
  962. II) On systems without such a suitable randomness source, automatic seeding
  963. and reseeding is disabled (--with-rand-seed=none) and it may be necessary
  964. to install additional support software to obtain a random seed and reseed
  965. the CSPRNG manually. Please check out the manual pages for RAND_add(),
  966. RAND_bytes(), RAND_egd(), and the FAQ for more information.