INSTALL 53 KB

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