Add an early reference to BN_CTX_new so that the usage of BN_CTX_start
[openssl.git] / FAQ
1 OpenSSL  -  Frequently Asked Questions
2 --------------------------------------
3
4 * Which is the current version of OpenSSL?
5 * Where is the documentation?
6 * How can I contact the OpenSSL developers?
7 * Do I need patent licenses to use OpenSSL?
8 * Is OpenSSL thread-safe?
9 * Why do I get a "PRNG not seeded" error message?
10 * Why does the linker complain about undefined symbols?
11 * Where can I get a compiled version of OpenSSL?
12 * I've compiled a program under Windows and it crashes: why?
13 * I've called <some function> and it fails, why?
14 * I just get a load of numbers for the error output, what do they mean?
15 * Why do I get errors about unknown algorithms?
16 * How do I create certificates or certificate requests?
17 * Why can't I create certificate requests?
18 * Why does <SSL program> fail with a certificate verify error?
19 * Why can I only use weak ciphers when I connect to a server using OpenSSL?
20 * How can I create DSA certificates?
21 * Why can't I make an SSL connection using a DSA certificate?
22 * How can I remove the passphrase on a private key?
23 * Why can't the OpenSSH configure script detect OpenSSL?
24 * Why does the OpenSSL test fail with "bc: command not found"?
25 * Why does the OpenSSL test fail with "bc: 1 no implemented"?
26 * Why does the OpenSSL compilation fail on Alpha True64 Unix?
27
28
29 * Which is the current version of OpenSSL?
30
31 The current version is available from <URL: http://www.openssl.org>.
32 OpenSSL 0.9.5a was released on April 1st, 2000.
33
34 In addition to the current stable release, you can also access daily
35 snapshots of the OpenSSL development version at <URL:
36 ftp://ftp.openssl.org/snapshot/>, or get it by anonymous CVS access.
37
38
39 * Where is the documentation?
40
41 OpenSSL is a library that provides cryptographic functionality to
42 applications such as secure web servers.  Be sure to read the
43 documentation of the application you want to use.  The INSTALL file
44 explains how to install this library.
45
46 OpenSSL includes a command line utility that can be used to perform a
47 variety of cryptographic functions.  It is described in the openssl(1)
48 manpage.  Documentation for developers is currently being written.  A
49 few manual pages already are available; overviews over libcrypto and
50 libssl are given in the crypto(3) and ssl(3) manpages.
51
52 The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a
53 different directory if you specified one as described in INSTALL).
54 In addition, you can read the most current versions at
55 <URL: http://www.openssl.org/docs/>.
56
57 For information on parts of libcrypto that are not yet documented, you
58 might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's
59 predecessor, at <URL: http://www.columbia.edu/~ariel/ssleay/>.  Much
60 of this still applies to OpenSSL.
61
62 There is some documentation about certificate extensions and PKCS#12
63 in doc/openssl.txt
64
65 The original SSLeay documentation is included in OpenSSL as
66 doc/ssleay.txt.  It may be useful when none of the other resources
67 help, but please note that it reflects the obsolete version SSLeay
68 0.6.6.
69
70
71 * How can I contact the OpenSSL developers?
72
73 The README file describes how to submit bug reports and patches to
74 OpenSSL.  Information on the OpenSSL mailing lists is available from
75 <URL: http://www.openssl.org>.
76
77
78 * Do I need patent licenses to use OpenSSL?
79
80 The patents section of the README file lists patents that may apply to
81 you if you want to use OpenSSL.  For information on intellectual
82 property rights, please consult a lawyer.  The OpenSSL team does not
83 offer legal advice.
84
85 You can configure OpenSSL so as not to use RC5 and IDEA by using
86  ./config no-rc5 no-idea
87
88 Until the RSA patent expires, U.S. users may want to use
89  ./config no-rc5 no-idea no-rsa
90
91 Please note that you will *not* be able to communicate with most of
92 the popular web browsers without RSA support.
93
94
95 * Is OpenSSL thread-safe?
96
97 Yes (with limitations: an SSL connection may not concurrently be used
98 by multiple threads).  On Windows and many Unix systems, OpenSSL
99 automatically uses the multi-threaded versions of the standard
100 libraries.  If your platform is not one of these, consult the INSTALL
101 file.
102
103 Multi-threaded applications must provide two callback functions to
104 OpenSSL.  This is described in the threads(3) manpage.
105
106
107 * Why do I get a "PRNG not seeded" error message?
108
109 Cryptographic software needs a source of unpredictable data to work
110 correctly.  Many open source operating systems provide a "randomness
111 device" that serves this purpose.  On other systems, applications have
112 to call the RAND_add() or RAND_seed() function with appropriate data
113 before generating keys or performing public key encryption.
114
115 Some broken applications do not do this.  As of version 0.9.5, the
116 OpenSSL functions that need randomness report an error if the random
117 number generator has not been seeded with at least 128 bits of
118 randomness.  If this error occurs, please contact the author of the
119 application you are using.  It is likely that it never worked
120 correctly.  OpenSSL 0.9.5 and later make the error visible by refusing
121 to perform potentially insecure encryption.
122
123 On systems without /dev/urandom, it is a good idea to use the Entropy
124 Gathering Demon; see the RAND_egd() manpage for details.
125
126 Most components of the openssl command line tool try to use the
127 file $HOME/.rnd (or $RANDFILE, if this environment variable is set)
128 for seeding the PRNG.  If this file does not exist or is too short,
129 the "PRNG not seeded" error message may occur.
130
131 [Note to OpenSSL 0.9.5 users: The command "openssl rsa" in version
132 0.9.5 does not do this and will fail on systems without /dev/urandom
133 when trying to password-encrypt an RSA key!  This is a bug in the
134 library; try a later version instead.]
135
136 For Solaris 2.6, Tim Nibbe <tnibbe@sprint.net> and others have suggested
137 installing the SUNski package from Sun patch 105710-01 (Sparc) which
138 adds a /dev/random device and make sure it gets used, usually through
139 $RANDFILE.  There are probably similar patches for the other Solaris
140 versions.  However, be warned that /dev/random is usually a blocking
141 device, which may have som effects on OpenSSL.
142
143
144 * Why does the linker complain about undefined symbols?
145
146 Maybe the compilation was interrupted, and make doesn't notice that
147 something is missing.  Run "make clean; make".
148
149 If you used ./Configure instead of ./config, make sure that you
150 selected the right target.  File formats may differ slightly between
151 OS versions (for example sparcv8/sparcv9, or a.out/elf).
152
153 In case you get errors about the following symbols, use the config
154 option "no-asm", as described in INSTALL:
155
156  BF_cbc_encrypt, BF_decrypt, BF_encrypt, CAST_cbc_encrypt,
157  CAST_decrypt, CAST_encrypt, RC4, RC5_32_cbc_encrypt, RC5_32_decrypt,
158  RC5_32_encrypt, bn_add_words, bn_div_words, bn_mul_add_words,
159  bn_mul_comba4, bn_mul_comba8, bn_mul_words, bn_sqr_comba4,
160  bn_sqr_comba8, bn_sqr_words, bn_sub_words, des_decrypt3,
161  des_ede3_cbc_encrypt, des_encrypt, des_encrypt2, des_encrypt3,
162  des_ncbc_encrypt, md5_block_asm_host_order, sha1_block_asm_data_order
163
164 If none of these helps, you may want to try using the current snapshot.
165 If the problem persists, please submit a bug report.
166
167
168 * Where can I get a compiled version of OpenSSL?
169
170 Some applications that use OpenSSL are distributed in binary form.
171 When using such an application, you don't need to install OpenSSL
172 yourself; the application will include the required parts (e.g. DLLs).
173
174 If you want to install OpenSSL on a Windows system and you don't have
175 a C compiler, read the "Mingw32" section of INSTALL.W32 for information
176 on how to obtain and install the free GNU C compiler.
177
178 A number of Linux and *BSD distributions include OpenSSL.
179
180
181 * I've compiled a program under Windows and it crashes: why?
182
183 This is usually because you've missed the comment in INSTALL.W32. You
184 must link with the multithreaded DLL version of the VC++ runtime library
185 otherwise the conflict will cause a program to crash: typically on the
186 first BIO related read or write operation.
187
188
189 * I've called <some function> and it fails, why?
190
191 Before submitting a report or asking in one of the mailing lists, you
192 should try to determine the cause. In particular, you should call
193 ERR_print_errors() or ERR_print_errors_fp() after the failed call
194 and see if the message helps. Note that the problem may occur earlier
195 than you think -- you should check for errors after every call where
196 it is possible, otherwise the actual problem may be hidden because
197 some OpenSSL functions clear the error state.
198
199
200 * I just get a load of numbers for the error output, what do they mean?
201
202 The actual format is described in the ERR_print_errors() manual page.
203 You should call the function ERR_load_crypto_strings() before hand and
204 the message will be output in text form. If you can't do this (for example
205 it is a pre-compiled binary) you can use the errstr utility on the error
206 code itself (the hex digits after the second colon).
207
208
209 * Why do I get errors about unknown algorithms?
210
211 This can happen under several circumstances such as reading in an
212 encrypted private key or attempting to decrypt a PKCS#12 file. The cause
213 is forgetting to load OpenSSL's table of algorithms with
214 OpenSSL_add_all_algorithms(). See the manual page for more information.
215
216
217 * How do I create certificates or certificate requests?
218
219 Check out the CA.pl(1) manual page. This provides a simple wrapper round
220 the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check
221 out the manual pages for the individual utilities and the certificate
222 extensions documentation (currently in doc/openssl.txt).
223
224
225 * Why can't I create certificate requests?
226
227 You typically get the error:
228
229         unable to find 'distinguished_name' in config
230         problems making Certificate Request
231
232 This is because it can't find the configuration file. Check out the
233 DIAGNOSTICS section of req(1) for more information.
234
235
236 * Why does <SSL program> fail with a certificate verify error?
237
238 This problem is usually indicated by log messages saying something like
239 "unable to get local issuer certificate" or "self signed certificate".
240 When a certificate is verified its root CA must be "trusted" by OpenSSL
241 this typically means that the CA certificate must be placed in a directory
242 or file and the relevant program configured to read it. The OpenSSL program
243 'verify' behaves in a similar way and issues similar error messages: check
244 the verify(1) program manual page for more information.
245
246
247 * Why can I only use weak ciphers when I connect to a server using OpenSSL?
248
249 This is almost certainly because you are using an old "export grade" browser
250 which only supports weak encryption. Upgrade your browser to support 128 bit
251 ciphers.
252
253
254 * How can I create DSA certificates?
255
256 Check the CA.pl(1) manual page for a DSA certificate example.
257
258
259 * Why can't I make an SSL connection to a server using a DSA certificate?
260
261 Typically you'll see a message saying there are no shared ciphers when
262 the same setup works fine with an RSA certificate. There are two possible
263 causes. The client may not support connections to DSA servers most web
264 browsers (including Netscape and MSIE) only support connections to servers
265 supporting RSA cipher suites. The other cause is that a set of DH parameters
266 has not been supplied to the server. DH parameters can be created with the
267 dhparam(1) command and loaded using the SSL_CTX_set_tmp_dh() for example:
268 check the source to s_server in apps/s_server.c for an example.
269
270
271 * How can I remove the passphrase on a private key?
272
273 Firstly you should be really *really* sure you want to do this. Leaving
274 a private key unencrypted is a major security risk. If you decide that
275 you do have to do this check the EXAMPLES sections of the rsa(1) and
276 dsa(1) manual pages.
277
278
279 * Why can't the OpenSSH configure script detect OpenSSL?
280
281 There is a problem with OpenSSH 1.2.2p1, in that the configure script
282 can't find the installed OpenSSL libraries.  The problem is actually
283 a small glitch that is easily solved with the following patch to be
284 applied to the OpenSSH distribution:
285
286 ----- snip:start -----
287 --- openssh-1.2.2p1/configure.in.orig   Thu Mar 23 18:56:58 2000
288 +++ openssh-1.2.2p1/configure.in        Thu Mar 23 18:55:05 2000
289 @@ -152,10 +152,10 @@
290  AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
291  for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
292         if test ! -z "$ssldir" ; then
293 -               LIBS="$saved_LIBS -L$ssldir"
294 +               LIBS="$saved_LIBS -L$ssldir/lib"
295                 CFLAGS="$CFLAGS -I$ssldir/include"
296                 if test "x$need_dash_r" = "x1" ; then
297 -                       LIBS="$LIBS -R$ssldir"
298 +                       LIBS="$LIBS -R$ssldir/lib"
299                 fi
300         fi
301         LIBS="$LIBS -lcrypto"
302 --- openssh-1.2.2p1/configure.orig      Thu Mar 23 18:55:02 2000
303 +++ openssh-1.2.2p1/configure   Thu Mar 23 18:57:08 2000
304 @@ -1890,10 +1890,10 @@
305  echo "configure:1891: checking for OpenSSL/SSLeay directory" >&5
306  for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
307         if test ! -z "$ssldir" ; then
308 -               LIBS="$saved_LIBS -L$ssldir"
309 +               LIBS="$saved_LIBS -L$ssldir/lib"
310                 CFLAGS="$CFLAGS -I$ssldir/include"
311                 if test "x$need_dash_r" = "x1" ; then
312 -                       LIBS="$LIBS -R$ssldir"
313 +                       LIBS="$LIBS -R$ssldir/lib"
314                 fi
315         fi
316         LIBS="$LIBS -lcrypto"
317 ----- snip:end -----
318
319
320 * Why does the OpenSSL test fail with "bc: command not found"?
321
322 You didn't install "bc", the Unix calculator.  If you want to run the
323 tests, get GNU bc from ftp://ftp.gnu.org or from your OS distributor.
324
325
326 * Why does the OpenSSL test fail with "bc: 1 no implemented"?
327
328 On some SCO installations or versions, bc has a bug that gets triggered when
329 you run the test suite (using "make test").  The message returned is "bc:
330 1 not implemented".  The best way to deal with this is to find another
331 implementation of bc and compile/install it.  For example, GNU bc (see
332 http://www.gnu.org/software/software.html for download instructions) can
333 be safely used.
334
335
336 * Why does the OpenSSL compilation fail on Alpha True64 Unix?
337
338 On some Alpha installations running True64 Unix and Compaq C, the compilation
339 of crypto/sha/sha_dgst.c fails with the message 'Fatal:  Insufficient virtual
340 memory to continue compilation.'  As far as the tests have shown, this may be
341 a compiler bug.  What happens is that it eats up a lot of resident memory
342 to build something, probably a table.  The problem is clearly in the
343 optimization code, because if one eliminates optimization completely (-O0),
344 the compilation goes through (and the compiler consumes about 2MB of resident
345 memory instead of 240MB or whatever one's limit is currently).
346
347 There are three options to solve this problem:
348
349 1. set your current data segment size soft limit higher.  Experience shows
350 that about 241000 kbytes seems to be enough on an AlphaServer DS10.  You do
351 this with the command 'ulimit -Sd nnnnnn', where 'nnnnnn' is the number of
352 kbytes to set the limit to.
353
354 2. If you have a hard limit that is lower than what you need and you can't
355 get it changed, you can compile all of OpenSSL with -O0 as optimization
356 level.  This is however not a very nice thing to do for those who expect to
357 get the best result from OpenSSL.  A bit more complicated solution is the
358 following:
359
360 ----- snip:start -----
361   make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile.ssl | \
362        sed -e 's/ -O[0-9] / -O0 /'`"
363   rm `ls crypto/*.o crypto/sha/*.o | grep -v 'sha_dgst\.o'`
364   make
365 ----- snip:end -----
366
367 This will only compile sha_dgst.c with -O0, the rest with the optimization
368 level chosen by the configuration process.  When the above is done, do the
369 test and installation and you're set.
370