INSTALL 52 KB

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