FAQ 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  1. OpenSSL - Frequently Asked Questions
  2. --------------------------------------
  3. [MISC] Miscellaneous questions
  4. * Which is the current version of OpenSSL?
  5. * Where is the documentation?
  6. * How can I contact the OpenSSL developers?
  7. * Where can I get a compiled version of OpenSSL?
  8. * Why aren't tools like 'autoconf' and 'libtool' used?
  9. * What is an 'engine' version?
  10. * How do I check the authenticity of the OpenSSL distribution?
  11. * How does the versioning scheme work?
  12. [LEGAL] Legal questions
  13. * Do I need patent licenses to use OpenSSL?
  14. * Can I use OpenSSL with GPL software?
  15. [USER] Questions on using the OpenSSL applications
  16. * Why do I get a "PRNG not seeded" error message?
  17. * Why do I get an "unable to write 'random state'" error message?
  18. * How do I create certificates or certificate requests?
  19. * Why can't I create certificate requests?
  20. * Why does <SSL program> fail with a certificate verify error?
  21. * Why can I only use weak ciphers when I connect to a server using OpenSSL?
  22. * How can I create DSA certificates?
  23. * Why can't I make an SSL connection using a DSA certificate?
  24. * How can I remove the passphrase on a private key?
  25. * Why can't I use OpenSSL certificates with SSL client authentication?
  26. * Why does my browser give a warning about a mismatched hostname?
  27. * How do I install a CA certificate into a browser?
  28. * Why is OpenSSL x509 DN output not conformant to RFC2253?
  29. * What is a "128 bit certificate"? Can I create one with OpenSSL?
  30. * Why does OpenSSL set the authority key identifier extension incorrectly?
  31. * How can I set up a bundle of commercial root CA certificates?
  32. * Some secure servers 'hang' with OpenSSL 1.0.1, is this a bug?
  33. [BUILD] Questions about building and testing OpenSSL
  34. * Why does the linker complain about undefined symbols?
  35. * Why does the OpenSSL test fail with "bc: command not found"?
  36. * Why does the OpenSSL test fail with "bc: 1 no implemented"?
  37. * Why does the OpenSSL test fail with "bc: stack empty"?
  38. * Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
  39. * Why does the OpenSSL compilation fail with "ar: command not found"?
  40. * Why does the OpenSSL compilation fail on Win32 with VC++?
  41. * What is special about OpenSSL on Redhat?
  42. * Why does the OpenSSL compilation fail on MacOS X?
  43. * Why does the OpenSSL test suite fail on MacOS X?
  44. * Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
  45. * Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
  46. * Why does the OpenSSL test suite fail in sha512t on x86 CPU?
  47. * Why does compiler fail to compile sha512.c?
  48. * Test suite still fails, what to do?
  49. * I think I've found a bug, what should I do?
  50. * I'm SURE I've found a bug, how do I report it?
  51. * I've found a security issue, how do I report it?
  52. [PROG] Questions about programming with OpenSSL
  53. * Is OpenSSL thread-safe?
  54. * I've compiled a program under Windows and it crashes: why?
  55. * How do I read or write a DER encoded buffer using the ASN1 functions?
  56. * OpenSSL uses DER but I need BER format: does OpenSSL support BER?
  57. * I've tried using <M_some_evil_pkcs12_macro> and I get errors why?
  58. * I've called <some function> and it fails, why?
  59. * I just get a load of numbers for the error output, what do they mean?
  60. * Why do I get errors about unknown algorithms?
  61. * Why can't the OpenSSH configure script detect OpenSSL?
  62. * Can I use OpenSSL's SSL library with non-blocking I/O?
  63. * Why doesn't my server application receive a client certificate?
  64. * Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
  65. * I think I've detected a memory leak, is this a bug?
  66. * Why does Valgrind complain about the use of uninitialized data?
  67. * Why doesn't a memory BIO work when a file does?
  68. * Where are the declarations and implementations of d2i_X509() etc?
  69. * When debugging I observe SIGILL during OpenSSL initialization: why?
  70. ===============================================================================
  71. [MISC] ========================================================================
  72. * Which is the current version of OpenSSL?
  73. The current version is available from <URL: http://www.openssl.org>.
  74. In addition to the current stable release, you can also access daily
  75. snapshots of the OpenSSL development version at <URL:
  76. ftp://ftp.openssl.org/snapshot/>, or get it by anonymous Git access.
  77. * Where is the documentation?
  78. OpenSSL is a library that provides cryptographic functionality to
  79. applications such as secure web servers. Be sure to read the
  80. documentation of the application you want to use. The INSTALL file
  81. explains how to install this library.
  82. OpenSSL includes a command line utility that can be used to perform a
  83. variety of cryptographic functions. It is described in the openssl(1)
  84. manpage. Documentation for developers is currently being written. Many
  85. manual pages are available; overviews over libcrypto and
  86. libssl are given in the crypto(3) and ssl(3) manpages.
  87. The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a
  88. different directory if you specified one as described in INSTALL).
  89. In addition, you can read the most current versions at
  90. <URL: http://www.openssl.org/docs/>. Note that the online documents refer
  91. to the very latest development versions of OpenSSL and may include features
  92. not present in released versions. If in doubt refer to the documentation
  93. that came with the version of OpenSSL you are using. The pod format
  94. documentation is included in each OpenSSL distribution under the docs
  95. directory.
  96. There is some documentation about certificate extensions and PKCS#12
  97. in doc/openssl.txt
  98. The original SSLeay documentation is included in OpenSSL as
  99. doc/ssleay.txt. It may be useful when none of the other resources
  100. help, but please note that it reflects the obsolete version SSLeay
  101. 0.6.6.
  102. * How can I contact the OpenSSL developers?
  103. The README file describes how to submit bug reports and patches to
  104. OpenSSL. Information on the OpenSSL mailing lists is available from
  105. <URL: http://www.openssl.org>.
  106. * Where can I get a compiled version of OpenSSL?
  107. You can finder pointers to binary distributions in
  108. <URL: http://www.openssl.org/about/binaries.html> .
  109. Some applications that use OpenSSL are distributed in binary form.
  110. When using such an application, you don't need to install OpenSSL
  111. yourself; the application will include the required parts (e.g. DLLs).
  112. If you want to build OpenSSL on a Windows system and you don't have
  113. a C compiler, read the "Mingw32" section of INSTALL.W32 for information
  114. on how to obtain and install the free GNU C compiler.
  115. A number of Linux and *BSD distributions include OpenSSL.
  116. * Why aren't tools like 'autoconf' and 'libtool' used?
  117. autoconf will probably be used in future OpenSSL versions. If it was
  118. less Unix-centric, it might have been used much earlier.
  119. * What is an 'engine' version?
  120. With version 0.9.6 OpenSSL was extended to interface to external crypto
  121. hardware. This was realized in a special release '0.9.6-engine'. With
  122. version 0.9.7 the changes were merged into the main development line,
  123. so that the special release is no longer necessary.
  124. * How do I check the authenticity of the OpenSSL distribution?
  125. We provide MD5 digests and ASC signatures of each tarball.
  126. Use MD5 to check that a tarball from a mirror site is identical:
  127. md5sum TARBALL | awk '{print $1;}' | cmp - TARBALL.md5
  128. You can check authenticity using pgp or gpg. You need the OpenSSL team
  129. member public key used to sign it (download it from a key server, see a
  130. list of keys at <URL: http://www.openssl.org/about/>). Then
  131. just do:
  132. pgp TARBALL.asc
  133. * How does the versioning scheme work?
  134. After the release of OpenSSL 1.0.0 the versioning scheme changed. Letter
  135. releases (e.g. 1.0.1a) can only contain bug and security fixes and no
  136. new features. Minor releases change the last number (e.g. 1.0.2) and
  137. can contain new features that retain binary compatibility. Changes to
  138. the middle number are considered major releases and neither source nor
  139. binary compatibility is guaranteed.
  140. Therefore the answer to the common question "when will feature X be
  141. backported to OpenSSL 1.0.0/0.9.8?" is "never" but it could appear
  142. in the next minor release.
  143. * What happens when the letter release reaches z?
  144. It was decided after the release of OpenSSL 0.9.8y the next version should
  145. be 0.9.8za then 0.9.8zb and so on.
  146. [LEGAL] =======================================================================
  147. * Do I need patent licenses to use OpenSSL?
  148. For information on intellectual property rights, please consult a lawyer.
  149. The OpenSSL team does not offer legal advice.
  150. You can configure OpenSSL so as not to use IDEA, MDC2 and RC5 by using
  151. ./config no-idea no-mdc2 no-rc5
  152. * Can I use OpenSSL with GPL software?
  153. On many systems including the major Linux and BSD distributions, yes (the
  154. GPL does not place restrictions on using libraries that are part of the
  155. normal operating system distribution).
  156. On other systems, the situation is less clear. Some GPL software copyright
  157. holders claim that you infringe on their rights if you use OpenSSL with
  158. their software on operating systems that don't normally include OpenSSL.
  159. If you develop open source software that uses OpenSSL, you may find it
  160. useful to choose an other license than the GPL, or state explicitly that
  161. "This program is released under the GPL with the additional exemption that
  162. compiling, linking, and/or using OpenSSL is allowed." If you are using
  163. GPL software developed by others, you may want to ask the copyright holder
  164. for permission to use their software with OpenSSL.
  165. [USER] ========================================================================
  166. * Why do I get a "PRNG not seeded" error message?
  167. Cryptographic software needs a source of unpredictable data to work
  168. correctly. Many open source operating systems provide a "randomness
  169. device" (/dev/urandom or /dev/random) that serves this purpose.
  170. All OpenSSL versions try to use /dev/urandom by default; starting with
  171. version 0.9.7, OpenSSL also tries /dev/random if /dev/urandom is not
  172. available.
  173. On other systems, applications have to call the RAND_add() or
  174. RAND_seed() function with appropriate data before generating keys or
  175. performing public key encryption. (These functions initialize the
  176. pseudo-random number generator, PRNG.) Some broken applications do
  177. not do this. As of version 0.9.5, the OpenSSL functions that need
  178. randomness report an error if the random number generator has not been
  179. seeded with at least 128 bits of randomness. If this error occurs and
  180. is not discussed in the documentation of the application you are
  181. using, please contact the author of that application; it is likely
  182. that it never worked correctly. OpenSSL 0.9.5 and later make the
  183. error visible by refusing to perform potentially insecure encryption.
  184. If you are using Solaris 8, you can add /dev/urandom and /dev/random
  185. devices by installing patch 112438 (Sparc) or 112439 (x86), which are
  186. available via the Patchfinder at <URL: http://sunsolve.sun.com>
  187. (Solaris 9 includes these devices by default). For /dev/random support
  188. for earlier Solaris versions, see Sun's statement at
  189. <URL: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski>
  190. (the SUNWski package is available in patch 105710).
  191. On systems without /dev/urandom and /dev/random, it is a good idea to
  192. use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
  193. details. Starting with version 0.9.7, OpenSSL will automatically look
  194. for an EGD socket at /var/run/egd-pool, /dev/egd-pool, /etc/egd-pool and
  195. /etc/entropy.
  196. Most components of the openssl command line utility automatically try
  197. to seed the random number generator from a file. The name of the
  198. default seeding file is determined as follows: If environment variable
  199. RANDFILE is set, then it names the seeding file. Otherwise if
  200. environment variable HOME is set, then the seeding file is $HOME/.rnd.
  201. If neither RANDFILE nor HOME is set, versions up to OpenSSL 0.9.6 will
  202. use file .rnd in the current directory while OpenSSL 0.9.6a uses no
  203. default seeding file at all. OpenSSL 0.9.6b and later will behave
  204. similarly to 0.9.6a, but will use a default of "C:\" for HOME on
  205. Windows systems if the environment variable has not been set.
  206. If the default seeding file does not exist or is too short, the "PRNG
  207. not seeded" error message may occur.
  208. The openssl command line utility will write back a new state to the
  209. default seeding file (and create this file if necessary) unless
  210. there was no sufficient seeding.
  211. Pointing $RANDFILE to an Entropy Gathering Daemon socket does not work.
  212. Use the "-rand" option of the OpenSSL command line tools instead.
  213. The $RANDFILE environment variable and $HOME/.rnd are only used by the
  214. OpenSSL command line tools. Applications using the OpenSSL library
  215. provide their own configuration options to specify the entropy source,
  216. please check out the documentation coming the with application.
  217. * Why do I get an "unable to write 'random state'" error message?
  218. Sometimes the openssl command line utility does not abort with
  219. a "PRNG not seeded" error message, but complains that it is
  220. "unable to write 'random state'". This message refers to the
  221. default seeding file (see previous answer). A possible reason
  222. is that no default filename is known because neither RANDFILE
  223. nor HOME is set. (Versions up to 0.9.6 used file ".rnd" in the
  224. current directory in this case, but this has changed with 0.9.6a.)
  225. * How do I create certificates or certificate requests?
  226. Check out the CA.pl(1) manual page. This provides a simple wrapper round
  227. the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check
  228. out the manual pages for the individual utilities and the certificate
  229. extensions documentation (in ca(1), req(1), x509v3_config(5) )
  230. * Why can't I create certificate requests?
  231. You typically get the error:
  232. unable to find 'distinguished_name' in config
  233. problems making Certificate Request
  234. This is because it can't find the configuration file. Check out the
  235. DIAGNOSTICS section of req(1) for more information.
  236. * Why does <SSL program> fail with a certificate verify error?
  237. This problem is usually indicated by log messages saying something like
  238. "unable to get local issuer certificate" or "self signed certificate".
  239. When a certificate is verified its root CA must be "trusted" by OpenSSL
  240. this typically means that the CA certificate must be placed in a directory
  241. or file and the relevant program configured to read it. The OpenSSL program
  242. 'verify' behaves in a similar way and issues similar error messages: check
  243. the verify(1) program manual page for more information.
  244. * Why can I only use weak ciphers when I connect to a server using OpenSSL?
  245. This is almost certainly because you are using an old "export grade" browser
  246. which only supports weak encryption. Upgrade your browser to support 128 bit
  247. ciphers.
  248. * How can I create DSA certificates?
  249. Check the CA.pl(1) manual page for a DSA certificate example.
  250. * Why can't I make an SSL connection to a server using a DSA certificate?
  251. Typically you'll see a message saying there are no shared ciphers when
  252. the same setup works fine with an RSA certificate. There are two possible
  253. causes. The client may not support connections to DSA servers most web
  254. browsers (including Netscape and MSIE) only support connections to servers
  255. supporting RSA cipher suites. The other cause is that a set of DH parameters
  256. has not been supplied to the server. DH parameters can be created with the
  257. dhparam(1) command and loaded using the SSL_CTX_set_tmp_dh() for example:
  258. check the source to s_server in apps/s_server.c for an example.
  259. * How can I remove the passphrase on a private key?
  260. Firstly you should be really *really* sure you want to do this. Leaving
  261. a private key unencrypted is a major security risk. If you decide that
  262. you do have to do this check the EXAMPLES sections of the rsa(1) and
  263. dsa(1) manual pages.
  264. * Why can't I use OpenSSL certificates with SSL client authentication?
  265. What will typically happen is that when a server requests authentication
  266. it will either not include your certificate or tell you that you have
  267. no client certificates (Netscape) or present you with an empty list box
  268. (MSIE). The reason for this is that when a server requests a client
  269. certificate it includes a list of CAs names which it will accept. Browsers
  270. will only let you select certificates from the list on the grounds that
  271. there is little point presenting a certificate which the server will
  272. reject.
  273. The solution is to add the relevant CA certificate to your servers "trusted
  274. CA list". How you do this depends on the server software in uses. You can
  275. print out the servers list of acceptable CAs using the OpenSSL s_client tool:
  276. openssl s_client -connect www.some.host:443 -prexit
  277. If your server only requests certificates on certain URLs then you may need
  278. to manually issue an HTTP GET command to get the list when s_client connects:
  279. GET /some/page/needing/a/certificate.html
  280. If your CA does not appear in the list then this confirms the problem.
  281. * Why does my browser give a warning about a mismatched hostname?
  282. Browsers expect the server's hostname to match the value in the commonName
  283. (CN) field of the certificate. If it does not then you get a warning.
  284. * How do I install a CA certificate into a browser?
  285. The usual way is to send the DER encoded certificate to the browser as
  286. MIME type application/x-x509-ca-cert, for example by clicking on an appropriate
  287. link. On MSIE certain extensions such as .der or .cacert may also work, or you
  288. can import the certificate using the certificate import wizard.
  289. You can convert a certificate to DER form using the command:
  290. openssl x509 -in ca.pem -outform DER -out ca.der
  291. Occasionally someone suggests using a command such as:
  292. openssl pkcs12 -export -out cacert.p12 -in cacert.pem -inkey cakey.pem
  293. DO NOT DO THIS! This command will give away your CAs private key and
  294. reduces its security to zero: allowing anyone to forge certificates in
  295. whatever name they choose.
  296. * Why is OpenSSL x509 DN output not conformant to RFC2253?
  297. The ways to print out the oneline format of the DN (Distinguished Name) have
  298. been extended in version 0.9.7 of OpenSSL. Using the new X509_NAME_print_ex()
  299. interface, the "-nameopt" option could be introduded. See the manual
  300. page of the "openssl x509" command line tool for details. The old behaviour
  301. has however been left as default for the sake of compatibility.
  302. * What is a "128 bit certificate"? Can I create one with OpenSSL?
  303. The term "128 bit certificate" is a highly misleading marketing term. It does
  304. *not* refer to the size of the public key in the certificate! A certificate
  305. containing a 128 bit RSA key would have negligible security.
  306. There were various other names such as "magic certificates", "SGC
  307. certificates", "step up certificates" etc.
  308. You can't generally create such a certificate using OpenSSL but there is no
  309. need to any more. Nowadays web browsers using unrestricted strong encryption
  310. are generally available.
  311. When there were tight restrictions on the export of strong encryption
  312. software from the US only weak encryption algorithms could be freely exported
  313. (initially 40 bit and then 56 bit). It was widely recognised that this was
  314. inadequate. A relaxation of the rules allowed the use of strong encryption but
  315. only to an authorised server.
  316. Two slightly different techniques were developed to support this, one used by
  317. Netscape was called "step up", the other used by MSIE was called "Server Gated
  318. Cryptography" (SGC). When a browser initially connected to a server it would
  319. check to see if the certificate contained certain extensions and was issued by
  320. an authorised authority. If these test succeeded it would reconnect using
  321. strong encryption.
  322. Only certain (initially one) certificate authorities could issue the
  323. certificates and they generally cost more than ordinary certificates.
  324. Although OpenSSL can create certificates containing the appropriate extensions
  325. the certificate would not come from a permitted authority and so would not
  326. be recognized.
  327. The export laws were later changed to allow almost unrestricted use of strong
  328. encryption so these certificates are now obsolete.
  329. * Why does OpenSSL set the authority key identifier (AKID) extension incorrectly?
  330. It doesn't: this extension is often the cause of confusion.
  331. Consider a certificate chain A->B->C so that A signs B and B signs C. Suppose
  332. certificate C contains AKID.
  333. The purpose of this extension is to identify the authority certificate B. This
  334. can be done either by including the subject key identifier of B or its issuer
  335. name and serial number.
  336. In this latter case because it is identifying certifcate B it must contain the
  337. issuer name and serial number of B.
  338. It is often wrongly assumed that it should contain the subject name of B. If it
  339. did this would be redundant information because it would duplicate the issuer
  340. name of C.
  341. * How can I set up a bundle of commercial root CA certificates?
  342. The OpenSSL software is shipped without any root CA certificate as the
  343. OpenSSL project does not have any policy on including or excluding
  344. any specific CA and does not intend to set up such a policy. Deciding
  345. about which CAs to support is up to application developers or
  346. administrators.
  347. Other projects do have other policies so you can for example extract the CA
  348. bundle used by Mozilla and/or modssl as described in this article:
  349. <URL: http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html>
  350. * Some secure servers 'hang' with OpenSSL 1.0.1, is this a bug?
  351. OpenSSL 1.0.1 is the first release to support TLS 1.2, among other things,
  352. this increases the size of the default ClientHello message to more than
  353. 255 bytes in length. Some software cannot handle this and hangs. For more
  354. details and workarounds see:
  355. <URL: http://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=2771>
  356. [BUILD] =======================================================================
  357. * Why does the linker complain about undefined symbols?
  358. Maybe the compilation was interrupted, and make doesn't notice that
  359. something is missing. Run "make clean; make".
  360. If you used ./Configure instead of ./config, make sure that you
  361. selected the right target. File formats may differ slightly between
  362. OS versions (for example sparcv8/sparcv9, or a.out/elf).
  363. In case you get errors about the following symbols, use the config
  364. option "no-asm", as described in INSTALL:
  365. BF_cbc_encrypt, BF_decrypt, BF_encrypt, CAST_cbc_encrypt,
  366. CAST_decrypt, CAST_encrypt, RC4, RC5_32_cbc_encrypt, RC5_32_decrypt,
  367. RC5_32_encrypt, bn_add_words, bn_div_words, bn_mul_add_words,
  368. bn_mul_comba4, bn_mul_comba8, bn_mul_words, bn_sqr_comba4,
  369. bn_sqr_comba8, bn_sqr_words, bn_sub_words, des_decrypt3,
  370. des_ede3_cbc_encrypt, des_encrypt, des_encrypt2, des_encrypt3,
  371. des_ncbc_encrypt, md5_block_asm_host_order, sha1_block_asm_data_order
  372. If none of these helps, you may want to try using the current snapshot.
  373. If the problem persists, please submit a bug report.
  374. * Why does the OpenSSL test fail with "bc: command not found"?
  375. You didn't install "bc", the Unix calculator. If you want to run the
  376. tests, get GNU bc from ftp://ftp.gnu.org or from your OS distributor.
  377. * Why does the OpenSSL test fail with "bc: 1 no implemented"?
  378. On some SCO installations or versions, bc has a bug that gets triggered
  379. when you run the test suite (using "make test"). The message returned is
  380. "bc: 1 not implemented".
  381. The best way to deal with this is to find another implementation of bc
  382. and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
  383. for download instructions) can be safely used, for example.
  384. * Why does the OpenSSL test fail with "bc: stack empty"?
  385. On some DG/ux versions, bc seems to have a too small stack for calculations
  386. that the OpenSSL bntest throws at it. This gets triggered when you run the
  387. test suite (using "make test"). The message returned is "bc: stack empty".
  388. The best way to deal with this is to find another implementation of bc
  389. and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
  390. for download instructions) can be safely used, for example.
  391. * Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
  392. On some Alpha installations running Tru64 Unix and Compaq C, the compilation
  393. of crypto/sha/sha_dgst.c fails with the message 'Fatal: Insufficient virtual
  394. memory to continue compilation.' As far as the tests have shown, this may be
  395. a compiler bug. What happens is that it eats up a lot of resident memory
  396. to build something, probably a table. The problem is clearly in the
  397. optimization code, because if one eliminates optimization completely (-O0),
  398. the compilation goes through (and the compiler consumes about 2MB of resident
  399. memory instead of 240MB or whatever one's limit is currently).
  400. There are three options to solve this problem:
  401. 1. set your current data segment size soft limit higher. Experience shows
  402. that about 241000 kbytes seems to be enough on an AlphaServer DS10. You do
  403. this with the command 'ulimit -Sd nnnnnn', where 'nnnnnn' is the number of
  404. kbytes to set the limit to.
  405. 2. If you have a hard limit that is lower than what you need and you can't
  406. get it changed, you can compile all of OpenSSL with -O0 as optimization
  407. level. This is however not a very nice thing to do for those who expect to
  408. get the best result from OpenSSL. A bit more complicated solution is the
  409. following:
  410. ----- snip:start -----
  411. make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile.ssl | \
  412. sed -e 's/ -O[0-9] / -O0 /'`"
  413. rm `ls crypto/*.o crypto/sha/*.o | grep -v 'sha_dgst\.o'`
  414. make
  415. ----- snip:end -----
  416. This will only compile sha_dgst.c with -O0, the rest with the optimization
  417. level chosen by the configuration process. When the above is done, do the
  418. test and installation and you're set.
  419. 3. Reconfigure the toolkit with no-sha0 option to leave out SHA0. It
  420. should not be used and is not used in SSL/TLS nor any other recognized
  421. protocol in either case.
  422. * Why does the OpenSSL compilation fail with "ar: command not found"?
  423. Getting this message is quite usual on Solaris 2, because Sun has hidden
  424. away 'ar' and other development commands in directories that aren't in
  425. $PATH by default. One of those directories is '/usr/ccs/bin'. The
  426. quickest way to fix this is to do the following (it assumes you use sh
  427. or any sh-compatible shell):
  428. ----- snip:start -----
  429. PATH=${PATH}:/usr/ccs/bin; export PATH
  430. ----- snip:end -----
  431. and then redo the compilation. What you should really do is make sure
  432. '/usr/ccs/bin' is permanently in your $PATH, for example through your
  433. '.profile' (again, assuming you use a sh-compatible shell).
  434. * Why does the OpenSSL compilation fail on Win32 with VC++?
  435. Sometimes, you may get reports from VC++ command line (cl) that it
  436. can't find standard include files like stdio.h and other weirdnesses.
  437. One possible cause is that the environment isn't correctly set up.
  438. To solve that problem for VC++ versions up to 6, one should run
  439. VCVARS32.BAT which is found in the 'bin' subdirectory of the VC++
  440. installation directory (somewhere under 'Program Files'). For VC++
  441. version 7 (and up?), which is also called VS.NET, the file is called
  442. VSVARS32.BAT instead.
  443. This needs to be done prior to running NMAKE, and the changes are only
  444. valid for the current DOS session.
  445. * What is special about OpenSSL on Redhat?
  446. Red Hat Linux (release 7.0 and later) include a preinstalled limited
  447. version of OpenSSL. Red Hat has chosen to disable support for IDEA, RC5 and
  448. MDC2 in this version. The same may apply to other Linux distributions.
  449. Users may therefore wish to install more or all of the features left out.
  450. To do this you MUST ensure that you do not overwrite the openssl that is in
  451. /usr/bin on your Red Hat machine. Several packages depend on this file,
  452. including sendmail and ssh. /usr/local/bin is a good alternative choice. The
  453. libraries that come with Red Hat 7.0 onwards have different names and so are
  454. not affected. (eg For Red Hat 7.2 they are /lib/libssl.so.0.9.6b and
  455. /lib/libcrypto.so.0.9.6b with symlinks /lib/libssl.so.2 and
  456. /lib/libcrypto.so.2 respectively).
  457. Please note that we have been advised by Red Hat attempting to recompile the
  458. openssl rpm with all the cryptography enabled will not work. All other
  459. packages depend on the original Red Hat supplied openssl package. It is also
  460. worth noting that due to the way Red Hat supplies its packages, updates to
  461. openssl on each distribution never change the package version, only the
  462. build number. For example, on Red Hat 7.1, the latest openssl package has
  463. version number 0.9.6 and build number 9 even though it contains all the
  464. relevant updates in packages up to and including 0.9.6b.
  465. A possible way around this is to persuade Red Hat to produce a non-US
  466. version of Red Hat Linux.
  467. * Why does the OpenSSL compilation fail on MacOS X?
  468. If the failure happens when trying to build the "openssl" binary, with
  469. a large number of undefined symbols, it's very probable that you have
  470. OpenSSL 0.9.6b delivered with the operating system (you can find out by
  471. running '/usr/bin/openssl version') and that you were trying to build
  472. OpenSSL 0.9.7 or newer. The problem is that the loader ('ld') in
  473. MacOS X has a misfeature that's quite difficult to go around.
  474. Look in the file PROBLEMS for a more detailed explanation and for possible
  475. solutions.
  476. * Why does the OpenSSL test suite fail on MacOS X?
  477. If the failure happens when running 'make test' and the RC4 test fails,
  478. it's very probable that you have OpenSSL 0.9.6b delivered with the
  479. operating system (you can find out by running '/usr/bin/openssl version')
  480. and that you were trying to build OpenSSL 0.9.6d. The problem is that
  481. the loader ('ld') in MacOS X has a misfeature that's quite difficult to
  482. go around and has linked the programs "openssl" and the test programs
  483. with /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib instead of the
  484. libraries you just built.
  485. Look in the file PROBLEMS for a more detailed explanation and for possible
  486. solutions.
  487. * Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
  488. Failure in BN_sqr test is most likely caused by a failure to configure the
  489. toolkit for current platform or lack of support for the platform in question.
  490. Run './config -t' and './apps/openssl version -p'. Do these platform
  491. identifiers match? If they don't, then you most likely failed to run
  492. ./config and you're hereby advised to do so before filing a bug report.
  493. If ./config itself fails to run, then it's most likely problem with your
  494. local environment and you should turn to your system administrator (or
  495. similar). If identifiers match (and/or no alternative identifier is
  496. suggested by ./config script), then the platform is unsupported. There might
  497. or might not be a workaround. Most notably on SPARC64 platforms with GNU
  498. C compiler you should be able to produce a working build by running
  499. './config -m32'. I understand that -m32 might not be what you want/need,
  500. but the build should be operational. For further details turn to
  501. <openssl-dev@openssl.org>.
  502. * Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
  503. As of 0.9.7 assembler routines were overhauled for position independence
  504. of the machine code, which is essential for shared library support. For
  505. some reason OpenBSD is equipped with an out-of-date GNU assembler which
  506. finds the new code offensive. To work around the problem, configure with
  507. no-asm (and sacrifice a great deal of performance) or patch your assembler
  508. according to <URL: http://www.openssl.org/~appro/gas-1.92.3.OpenBSD.patch>.
  509. For your convenience a pre-compiled replacement binary is provided at
  510. <URL: http://www.openssl.org/~appro/gas-1.92.3.static.aout.bin>.
  511. Reportedly elder *BSD a.out platforms also suffer from this problem and
  512. remedy should be same. Provided binary is statically linked and should be
  513. working across wider range of *BSD branches, not just OpenBSD.
  514. * Why does the OpenSSL test suite fail in sha512t on x86 CPU?
  515. If the test program in question fails withs SIGILL, Illegal Instruction
  516. exception, then you more than likely to run SSE2-capable CPU, such as
  517. Intel P4, under control of kernel which does not support SSE2
  518. instruction extensions. See accompanying INSTALL file and
  519. OPENSSL_ia32cap(3) documentation page for further information.
  520. * Why does compiler fail to compile sha512.c?
  521. OpenSSL SHA-512 implementation depends on compiler support for 64-bit
  522. integer type. Few elder compilers [ULTRIX cc, SCO compiler to mention a
  523. couple] lack support for this and therefore are incapable of compiling
  524. the module in question. The recommendation is to disable SHA-512 by
  525. adding no-sha512 to ./config [or ./Configure] command line. Another
  526. possible alternative might be to switch to GCC.
  527. * Test suite still fails, what to do?
  528. Another common reason for test failures is bugs in the toolchain
  529. or run-time environment. Known cases of this are documented in the
  530. PROBLEMS file, please review it before you beat the drum. Even if you
  531. don't find anything in that file, please do consider the possibility
  532. of a compiler bug. Compiler bugs often appear in rather bizarre ways,
  533. they never make sense, and tend to emerge when you least expect
  534. them. One thing to try is to reduce the level of optimization (such
  535. as by editing the CFLAG variable line in the top-level Makefile),
  536. and then recompile and re-run the test.
  537. * I think I've found a bug, what should I do?
  538. If you are a new user then it is quite likely you haven't found a bug and
  539. something is happening you aren't familiar with. Check this FAQ, the associated
  540. documentation and the mailing lists for similar queries. If you are still
  541. unsure whether it is a bug or not submit a query to the openssl-users mailing
  542. list.
  543. If you think you have found a bug based on the output of static analysis tools
  544. then please manually check the issue is genuine. Such tools can produce a
  545. LOT of false positives.
  546. * I'm SURE I've found a bug, how do I report it?
  547. To avoid duplicated reports check the mailing lists and release notes for the
  548. relevant version of OpenSSL to see if the problem has been reported already.
  549. Bug reports with no security implications should be sent to the request
  550. tracker. This can be done by mailing the report to <rt@openssl.org> (or its
  551. alias <openssl-bugs@openssl.org>), please note that messages sent to the
  552. request tracker also appear in the public openssl-dev mailing list.
  553. The report should be in plain text. Any patches should be sent as
  554. plain text attachments because some mailers corrupt patches sent inline.
  555. If your issue affects multiple versions of OpenSSL check any patches apply
  556. cleanly and, if possible include patches to each affected version.
  557. The report should be given a meaningful subject line briefly summarising the
  558. issue. Just "bug in OpenSSL" or "bug in OpenSSL 0.9.8n" is not very helpful.
  559. By sending reports to the request tracker the bug can then be given a priority
  560. and assigned to the appropriate maintainer. The history of discussions can be
  561. accessed and if the issue has been addressed or a reason why not. If patches
  562. are only sent to openssl-dev they can be mislaid if a team member has to
  563. wade through months of old messages to review the discussion.
  564. See also <URL: http://www.openssl.org/support/rt.html>
  565. * I've found a security issue, how do I report it?
  566. If you think your bug has security implications then please send it to
  567. openssl-security@openssl.org if you don't get a prompt reply at least
  568. acknowledging receipt then resend or mail it directly to one of the
  569. more active team members (e.g. Steve). If you wish to use PGP to send
  570. in a report please use one or more of the keys of the team members listed
  571. at <URL: http://www.openssl.org/about/>
  572. Note that bugs only present in the openssl utility are not in general
  573. considered to be security issues.
  574. [PROG] ========================================================================
  575. * Is OpenSSL thread-safe?
  576. Provided an application sets up the thread callback functions, the
  577. answer is yes. There are limitations; for example, an SSL connection
  578. cannot be used concurrently by multiple threads. This is true for
  579. most OpenSSL objects.
  580. To do this, your application must call CRYPTO_set_locking_callback()
  581. and one of the CRYPTO_THREADID_set...() API's. See the OpenSSL threads
  582. manpage for details and "note on multi-threading" in the INSTALL file in
  583. the source distribution.
  584. * I've compiled a program under Windows and it crashes: why?
  585. This is usually because you've missed the comment in INSTALL.W32.
  586. Your application must link against the same version of the Win32
  587. C-Runtime against which your openssl libraries were linked. The
  588. default version for OpenSSL is /MD - "Multithreaded DLL".
  589. If you are using Microsoft Visual C++'s IDE (Visual Studio), in
  590. many cases, your new project most likely defaulted to "Debug
  591. Singlethreaded" - /ML. This is NOT interchangeable with /MD and your
  592. program will crash, typically on the first BIO related read or write
  593. operation.
  594. For each of the six possible link stage configurations within Win32,
  595. your application must link against the same by which OpenSSL was
  596. built. If you are using MS Visual C++ (Studio) this can be changed
  597. by:
  598. 1. Select Settings... from the Project Menu.
  599. 2. Select the C/C++ Tab.
  600. 3. Select "Code Generation from the "Category" drop down list box
  601. 4. Select the Appropriate library (see table below) from the "Use
  602. run-time library" drop down list box. Perform this step for both
  603. your debug and release versions of your application (look at the
  604. top left of the settings panel to change between the two)
  605. Single Threaded /ML - MS VC++ often defaults to
  606. this for the release
  607. version of a new project.
  608. Debug Single Threaded /MLd - MS VC++ often defaults to
  609. this for the debug version
  610. of a new project.
  611. Multithreaded /MT
  612. Debug Multithreaded /MTd
  613. Multithreaded DLL /MD - OpenSSL defaults to this.
  614. Debug Multithreaded DLL /MDd
  615. Note that debug and release libraries are NOT interchangeable. If you
  616. built OpenSSL with /MD your application must use /MD and cannot use /MDd.
  617. As per 0.9.8 the above limitation is eliminated for .DLLs. OpenSSL
  618. .DLLs compiled with some specific run-time option [we insist on the
  619. default /MD] can be deployed with application compiled with different
  620. option or even different compiler. But there is a catch! Instead of
  621. re-compiling OpenSSL toolkit, as you would have to with prior versions,
  622. you have to compile small C snippet with compiler and/or options of
  623. your choice. The snippet gets installed as
  624. <install-root>/include/openssl/applink.c and should be either added to
  625. your application project or simply #include-d in one [and only one]
  626. of your application source files. Failure to link this shim module
  627. into your application manifests itself as fatal "no OPENSSL_Applink"
  628. run-time error. An explicit reminder is due that in this situation
  629. [mixing compiler options] it is as important to add CRYPTO_malloc_init
  630. prior first call to OpenSSL.
  631. * How do I read or write a DER encoded buffer using the ASN1 functions?
  632. You have two options. You can either use a memory BIO in conjunction
  633. with the i2d_*_bio() or d2i_*_bio() functions or you can use the
  634. i2d_*(), d2i_*() functions directly. Since these are often the
  635. cause of grief here are some code fragments using PKCS7 as an example:
  636. unsigned char *buf, *p;
  637. int len;
  638. len = i2d_PKCS7(p7, NULL);
  639. buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */
  640. p = buf;
  641. i2d_PKCS7(p7, &p);
  642. At this point buf contains the len bytes of the DER encoding of
  643. p7.
  644. The opposite assumes we already have len bytes in buf:
  645. unsigned char *p;
  646. p = buf;
  647. p7 = d2i_PKCS7(NULL, &p, len);
  648. At this point p7 contains a valid PKCS7 structure or NULL if an error
  649. occurred. If an error occurred ERR_print_errors(bio) should give more
  650. information.
  651. The reason for the temporary variable 'p' is that the ASN1 functions
  652. increment the passed pointer so it is ready to read or write the next
  653. structure. This is often a cause of problems: without the temporary
  654. variable the buffer pointer is changed to point just after the data
  655. that has been read or written. This may well be uninitialized data
  656. and attempts to free the buffer will have unpredictable results
  657. because it no longer points to the same address.
  658. Memory allocation and encoding can also be combined in a single
  659. operation by the ASN1 routines:
  660. unsigned char *buf = NULL; /* mandatory */
  661. int len;
  662. len = i2d_PKCS7(p7, &buf);
  663. if (len < 0)
  664. /* Error */
  665. /* Do some things with 'buf' */
  666. /* Finished with buf: free it */
  667. OPENSSL_free(buf);
  668. In this special case the "buf" parameter is *not* incremented, it points
  669. to the start of the encoding.
  670. * OpenSSL uses DER but I need BER format: does OpenSSL support BER?
  671. The short answer is yes, because DER is a special case of BER and OpenSSL
  672. ASN1 decoders can process BER.
  673. The longer answer is that ASN1 structures can be encoded in a number of
  674. different ways. One set of ways is the Basic Encoding Rules (BER) with various
  675. permissible encodings. A restriction of BER is the Distinguished Encoding
  676. Rules (DER): these uniquely specify how a given structure is encoded.
  677. Therefore, because DER is a special case of BER, DER is an acceptable encoding
  678. for BER.
  679. * I've tried using <M_some_evil_pkcs12_macro> and I get errors why?
  680. This usually happens when you try compiling something using the PKCS#12
  681. macros with a C++ compiler. There is hardly ever any need to use the
  682. PKCS#12 macros in a program, it is much easier to parse and create
  683. PKCS#12 files using the PKCS12_parse() and PKCS12_create() functions
  684. documented in doc/openssl.txt and with examples in demos/pkcs12. The
  685. 'pkcs12' application has to use the macros because it prints out
  686. debugging information.
  687. * I've called <some function> and it fails, why?
  688. Before submitting a report or asking in one of the mailing lists, you
  689. should try to determine the cause. In particular, you should call
  690. ERR_print_errors() or ERR_print_errors_fp() after the failed call
  691. and see if the message helps. Note that the problem may occur earlier
  692. than you think -- you should check for errors after every call where
  693. it is possible, otherwise the actual problem may be hidden because
  694. some OpenSSL functions clear the error state.
  695. * I just get a load of numbers for the error output, what do they mean?
  696. The actual format is described in the ERR_print_errors() manual page.
  697. You should call the function ERR_load_crypto_strings() before hand and
  698. the message will be output in text form. If you can't do this (for example
  699. it is a pre-compiled binary) you can use the errstr utility on the error
  700. code itself (the hex digits after the second colon).
  701. * Why do I get errors about unknown algorithms?
  702. The cause is forgetting to load OpenSSL's table of algorithms with
  703. OpenSSL_add_all_algorithms(). See the manual page for more information. This
  704. can cause several problems such as being unable to read in an encrypted
  705. PEM file, unable to decrypt a PKCS#12 file or signature failure when
  706. verifying certificates.
  707. * Why can't the OpenSSH configure script detect OpenSSL?
  708. Several reasons for problems with the automatic detection exist.
  709. OpenSSH requires at least version 0.9.5a of the OpenSSL libraries.
  710. Sometimes the distribution has installed an older version in the system
  711. locations that is detected instead of a new one installed. The OpenSSL
  712. library might have been compiled for another CPU or another mode (32/64 bits).
  713. Permissions might be wrong.
  714. The general answer is to check the config.log file generated when running
  715. the OpenSSH configure script. It should contain the detailed information
  716. on why the OpenSSL library was not detected or considered incompatible.
  717. * Can I use OpenSSL's SSL library with non-blocking I/O?
  718. Yes; make sure to read the SSL_get_error(3) manual page!
  719. A pitfall to avoid: Don't assume that SSL_read() will just read from
  720. the underlying transport or that SSL_write() will just write to it --
  721. it is also possible that SSL_write() cannot do any useful work until
  722. there is data to read, or that SSL_read() cannot do anything until it
  723. is possible to send data. One reason for this is that the peer may
  724. request a new TLS/SSL handshake at any time during the protocol,
  725. requiring a bi-directional message exchange; both SSL_read() and
  726. SSL_write() will try to continue any pending handshake.
  727. * Why doesn't my server application receive a client certificate?
  728. Due to the TLS protocol definition, a client will only send a certificate,
  729. if explicitly asked by the server. Use the SSL_VERIFY_PEER flag of the
  730. SSL_CTX_set_verify() function to enable the use of client certificates.
  731. * Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
  732. For OpenSSL 0.9.7 the OID table was extended and corrected. In earlier
  733. versions, uniqueIdentifier was incorrectly used for X.509 certificates.
  734. The correct name according to RFC2256 (LDAP) is x500UniqueIdentifier.
  735. Change your code to use the new name when compiling against OpenSSL 0.9.7.
  736. * I think I've detected a memory leak, is this a bug?
  737. In most cases the cause of an apparent memory leak is an OpenSSL internal table
  738. that is allocated when an application starts up. Since such tables do not grow
  739. in size over time they are harmless.
  740. These internal tables can be freed up when an application closes using various
  741. functions. Currently these include following:
  742. Thread-local cleanup functions:
  743. ERR_remove_state()
  744. Application-global cleanup functions that are aware of usage (and therefore
  745. thread-safe):
  746. ENGINE_cleanup() and CONF_modules_unload()
  747. "Brutal" (thread-unsafe) Application-global cleanup functions:
  748. ERR_free_strings(), EVP_cleanup() and CRYPTO_cleanup_all_ex_data().
  749. * Why does Valgrind complain about the use of uninitialized data?
  750. When OpenSSL's PRNG routines are called to generate random numbers the supplied
  751. buffer contents are mixed into the entropy pool: so it technically does not
  752. matter whether the buffer is initialized at this point or not. Valgrind (and
  753. other test tools) will complain about this. When using Valgrind, make sure the
  754. OpenSSL library has been compiled with the PURIFY macro defined (-DPURIFY)
  755. to get rid of these warnings.
  756. * Why doesn't a memory BIO work when a file does?
  757. This can occur in several cases for example reading an S/MIME email message.
  758. The reason is that a memory BIO can do one of two things when all the data
  759. has been read from it.
  760. The default behaviour is to indicate that no more data is available and that
  761. the call should be retried, this is to allow the application to fill up the BIO
  762. again if necessary.
  763. Alternatively it can indicate that no more data is available and that EOF has
  764. been reached.
  765. If a memory BIO is to behave in the same way as a file this second behaviour
  766. is needed. This must be done by calling:
  767. BIO_set_mem_eof_return(bio, 0);
  768. See the manual pages for more details.
  769. * Where are the declarations and implementations of d2i_X509() etc?
  770. These are defined and implemented by macros of the form:
  771. DECLARE_ASN1_FUNCTIONS(X509) and IMPLEMENT_ASN1_FUNCTIONS(X509)
  772. The implementation passes an ASN1 "template" defining the structure into an
  773. ASN1 interpreter using generalised functions such as ASN1_item_d2i().
  774. * When debugging I observe SIGILL during OpenSSL initialization: why?
  775. OpenSSL adapts to processor it executes on and for this reason has to
  776. query its capabilities. Unfortunately on some processors the only way
  777. to achieve this for non-privileged code is to attempt instructions
  778. that can cause Illegal Instruction exceptions. The initialization
  779. procedure is coded to handle these exceptions to manipulate corresponding
  780. bits in capabilities vector. This normally appears transparent, except
  781. when you execute it under debugger, which stops prior delivering signal
  782. to handler. Simply resuming execution does the trick, but when debugging
  783. a lot it might feel counterproductive. Two options. Either set explicit
  784. capability environment variable in order to bypass the capability query
  785. (see corresponding crypto/*cap.c for details). Or configure debugger not
  786. to stop upon SIGILL exception, e.g. in gdb case add 'handle SIGILL nostop'
  787. to your .gdbinit.
  788. ===============================================================================