INSTALL 55 KB

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