INSTALL 56 KB

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