• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.gdbinitH A D17-Oct-201421 21

CHANGESH A D04-Oct-20166 KiB154138

GNUmakefileH A D03-May-20226.8 KiB230169

LICENSEH A D18-Feb-200514.8 KiB281237

MakefileH A D05-Mar-20155 KiB162117

READMEH A D07-Oct-2003265 85

README.antidosH A D08-Apr-2008899 1714

README.bindbenchH A D09-Oct-2003581 1310

README.cgiH A D02-Jun-2009699 2113

README.forkbenchH A D09-Oct-2003406 107

README.ftpH A D02-Jun-20092.7 KiB6046

README.htaccessH A D31-Oct-2005605 1913

README.httpH A D02-Jun-20091,007 2618

README.httpbenchH A D02-Jun-20092.3 KiB8670

README.manymapbenchH A D23-Oct-20031.2 KiB2620

README.mmapbenchH A D11-Nov-20031.1 KiB2520

README.performanceH A D14-Jan-20041.4 KiB4837

README.phpH A D09-Jan-20101.1 KiB3221

README.polarsslH A D19-Aug-2011949 2719

README.prefetchH A D07-Jan-20042.2 KiB4034

README.proxyH A D09-Jan-20101.3 KiB3323

README.redirectH A D17-May-2005912 3319

README.tlsH A D07-Oct-20145.2 KiB11786

TODOH A D02-Mar-2015308 116

acc.cH A D27-Jun-20114.9 KiB225202

acc.plH A D09-Apr-2009542 2624

bench.1H A D29-Sep-20051.2 KiB3526

bench.cH A D09-Oct-201413.7 KiB604557

bindbench.cH A D08-Jan-20042.7 KiB134125

cgi.cH A D05-Jun-20141.4 KiB7569

common.cH A D03-Sep-20164.7 KiB222187

connstat.cH A D25-Apr-20162 KiB8774

dirfd.cH A D04-Oct-20166.3 KiB261218

dirfd.hH A D04-Oct-20161.4 KiB5831

dl.cH A D03-May-202255.3 KiB1,9811,815

forkbench.cH A D07-Nov-20032.5 KiB119112

ftp.cH A D01-Sep-201624.8 KiB988888

gatling.1H A D23-Apr-20155.7 KiB11796

gatling.cH A D03-May-202264.1 KiB2,5482,294

gatling.hH A D01-Sep-201616 KiB553457

gatling_features.hH A D23-Apr-20161.7 KiB6932

genofsmacro.plH A D08-Apr-2008407 176

getlinks.cH A D01-Jun-20107.7 KiB348314

getrusage.cH A D30-Mar-20051.4 KiB4238

hcat.cH A D18-Oct-20071.2 KiB4428

http.cH A D03-May-202294.5 KiB3,4843,015

httpbench.cH A D05-Dec-20139.2 KiB402384

httpstream.cH A D17-Dec-20149.7 KiB357268

ioerr.cH A D18-May-20065.1 KiB232217

manymapbench.cH A D23-Oct-20032.8 KiB137126

matchiprange.cH A D19-Jan-20103.4 KiB148128

mime.cH A D13-May-20169.5 KiB406365

mktestdata.cH A D06-Nov-20032.3 KiB9992

mmapbench.cH A D24-Oct-20032.9 KiB135127

prepH A D25-Aug-20101.1 KiB3937

pssl.cH A D13-May-20166.9 KiB203176

pssl.hH A D02-Mar-2016425 1815

pthreadbench.cH A D06-Nov-20032.1 KiB9688

readfrag.cH A D01-Dec-20064.5 KiB179156

referrer.cH A D27-Apr-20164.1 KiB198169

rellink.cH A D27-Jun-20116.9 KiB262229

run-benchH A D14-Nov-2003983 3433

run-gatlingH A D09-Oct-200346 43

run-valgrindH A D20-Aug-2010123 21

smb.cH A D03-May-202249.4 KiB1,6521,409

ssl.cH A D27-Apr-20168.5 KiB324260

torrent.cH A D17-Aug-20094.4 KiB177158

tryalloca.cH A D25-Apr-2016134 1210

trycrypt.cH A D25-Jul-2005235 1513

tryiconv.cH A D08-Jan-2004244 1614

trymd5.cH A D20-Feb-2008224 1513

trysetresuid.cH A D29-Jul-200696 86

trysocket.cH A D25-Apr-2016203 1311

README

1This is an experimental web server, meant to demonstrate how to write a
2scalable web server using the IO and IOB API from libowfat
3(http://www.fefe.de/libowfat/).
4
5To compile this, you will need the current libowfat version, probably
6even the current CVS version.
7
8

README.antidos

1gatling now supports some anti denial of service code.
2
3You can set a limit of how often each IP can request files from gatling
4per minute.  gatling will then keep book about which IPs had how many
5requests in the last minute, and if someone exceeds that limit, they
6will only be allowed back in if they did not request anything for a
7whole minute.
8
9If someone gets caught at DOSsing you, their connection will be
10tarpitted.  If gatling is run in no-timeout mode, the connection is
11dropped immediately instead.  The idea behind the tarpit is to stop
12accidental flooding (if we drop the connection, we might make an
13accidental flood worse due to immediate retry).  On the down side the
14tarpit allows others to consume resources on our box.  So it is still a
15denial of service on our resources if someone opens a lot of connections
16against us, because the state for the connections wastes our memory.
17

README.bindbench

1bindbench will create many sockets and then bind them to port 0 (i.e.
2tell the operating system to assign a free port to them).
3
4Ideally, this should be a constant time operation, but some
5implementations may implement selecting the smallest free port by
6traversing a list or array.
7
8On i386, bindbench will read the task cycle counter instead of
9gettimeofday and give the results in CPU cycles, not usec.  You can
10divide the numbers by the CPU frequency to get comparable numbers.  As
11there is no portable way to get the CPU frequency, bindbench does not
12even pretend to do this.
13

README.cgi

1Gatling now has primitive CGI support.
2
3To use it, touch ".proxy" in the root of the virtual host, for example
4
5  $ touch default/.proxy
6
7and then start gatling with -C and a regex by which to detect CGIs:
8
9  # gatling -C '\.cgi'
10
11You can also tell gatling to consider all executable files CGI programs:
12
13  # gatling -C+x
14
15Then, even index.html will be run as CGI if it is executable, allowing
16for example a dynamically generated homepage on http://example.com/
17without index.html having to do a lame redirect.  In this mode, gatling
18will do a primitive check and only run CGIs that have the ELF magic
19(i.e. look like an ELF binary) or the Shebang (#!, i.e. look like a
20shell/perl/whatever script).
21

README.forkbench

1forkbench will fork off many child processes (settable on the command
2line with -c, default is 1000).
3
4Each child will write a single character into a pipe, and the parent
5will read that single character out of the pipe.  Then the child will
6block and wait for SIGTERM.  The parent will take the time for creating
7the child and receiving the character.
8
9Ideally, this time should be more or less constant.
10

README.ftp

1gatling now also speaks FTP, and it is enabled per default.
2Disable it with -F.
3
4Working around itojun's disabled IPv4-mapped IPv6 addresses is even
5worse for FTP than it is for HTTP.  I'm not going to waste my time on
6this for now.  Please ask itojun himself to prove how "easy" or even
7"trivial" it is to do this, as he always claims it is.
8
9Like HTTP will bind to port 80 if running as root, or 8000 otherwise,
10FTP will bind to port 21 and 2121.  To specify the FTP port, use
11-f -p [port].  Example:
12
13  gatling -p 81 -f -p 2100
14
15would run a HTTP server on port 81 and an FTP server on port 2100.  For
16now, HTTP and FTP will always bind to the same IP number.
17
18Please note:
19
20  a) No TELNET sequences.
21     These are _really_ obsolete, a pain in the ass to implement, and
22     have even been used as means to avoid intrusion detection systems
23     due to the obscurity.
24
25  b) The path checking deliberately _allows_ to leave the file system,
26     as long as you follow a symbolic link in the process.  That means,
27     if you symlink out of the FTP file system (and the destination is in
28     the chroot jail), gatling will allow FTP (and HTTP!) users to
29     follow the symlink.  However, following a directory symlink and
30     appending "/../" will not follow the .. directory entry from the
31     target directory of the symlink, as an attacker may hope.
32
33     The idea is to make it easy to create an FTP Server by putting a
34     few symlinks to directories you want to export in an empty
35     directory and starting gatling there.
36
37  c) Like for HTTP, gatling will do virtual hosting, i.e. if the client
38     connected to IP 10.1.1.23 on port 21, gatling will look for the
39     exported data in the directory "10.1.1.23:21".
40
41  d) gatling will not let users download files that are not world
42     readable, even if the permissions would normally allow the gatling
43     process to read the files.  This is to prevent accidental
44     publication of sensitive files.
45
46  e) gatling accepts uploads per anonymous FTP, but only to directories
47     that are world writable.  Since there normally are no world
48     writable directories, this should not pose much of a threat to
49     anyone.  Please note that the files are created with mode 600,
50     which means gatling will not let others download uploaded files, so
51     it cannot be exploited as warez dump.
52
53     You can disable uploads altogether with -U, or you can allow
54     anonymous downloaders to download just uploaded files with -a.
55
56  f) gatling's directory listings will always claim files are owned by
57     root.  The local accounts on FTP sites are ignored by software and
58     not normally useful to outsiders anyway, but revealing them may
59     expose more of your organisation to FTP users than you want.
60

README.htaccess

1gatling supports very basic .htaccess handling.
2
3If checks (in the current directory only!) for a .htaccess file, which
4is expected to have the following syntax:
5
6  Realm
7  username:password
8  username2:password2
9  [...]
10
11Realm is simply a string that is usually displayed by the browser when
12prompting for the password.  username is the user name in plain text,
13and password is the password in crypt(3) format (like in /etc/passwd).
14
15gatling only supports basic authentication.
16
17You can also password protect a whole server.  Just put a
18.htaccess_global file in the directory of the server, same syntax.
19

README.http

1gatling is a non-forking HTTP server.
2It listens on port 80 when running as root, or port 8000 otherwise.
3You can specify the port with -p, i.e.
4
5  gatling -p 81
6
7to bind to port 81.  Run gatling -h to get a list of supported command
8line options.  Connection Keep-Alive and Pipelining are supported.
9
10Please note:
11
12  a) No HTTP/0.9 support
13
14  b) gatling deliberately _allows_ to leave the file system, as long as
15     the request follows a symbolic link in the process.  That means, if
16     you symlink out of the HTTP file system (and the destination is in
17     the chroot jail), gatling will allow HTTP (and FTP!) users to
18     follow the symlink.  However, following a directory symlink and
19     appending "/../" will not follow the .. directory entry from the
20     target directory of the symlink, as an attacker may hope.
21
22     The idea is to make it easy to create an FTP Server by putting a
23     few symlinks to directories you want to export in an empty
24     directory and starting gatling there.
25
26

README.httpbench

1httpbench is a latency measurement tool.
2
3Call it like this:
4
5  ./httpbench -k -c 1000 -i 10 -s 5 http://127.0.0.1:8000/README.httpbench
6
7This means that httpbench should open 500 HTTP connections to
8127.0.0.1:8000, and every 10 connections it should 5 times request "/"
9from the web server there.  The -k tells httpbench to run these 5
10requests over the same TCP connection, using HTTP keep-alive.
11
12The output from httpbench looks something like this:
13
14  connecting to 127.0.0.1 port 8000
15  sample 69 229
16  clat 58
17  clat 59
18  clat 51
19  clat 50
20  clat 52
21  clat 49
22  clat 50
23  clat 50
24  clat 63
25  clat 50
26  sample 50 389
27  [...]
28
29The first line is for informational purposes.
30
31Lines starting with "sample" give two timings, first the latency for
32opening the TCP connection (which should be pretty small unless the web
33server has problems calling accept() as fast as incoming connections
34arrive).  The second is the average latency for writing the HTTP request
35and reading the answer.  The timings are in ?s.
36
37Lines starting with "clat" give the normal TCP connect() latency.  Since
38this does not incur any actual work for the HTTP server (besides getting
39the event and calling accept()), this should be uniformly small.
40
41Here are a few useful command lines to plot this with gnuplot:
42
43  plot "linux.log" using ($2) title "Linux 2.6: connect latency" with histeps
44
45  plot "linux.log" using ($3) title "Linux 2.6: response latency" with histeps
46
47httpbench can also be used to measure throughput.  To do that, run it
48with -c 1 and give the URL to a large file (an ISO image or movie file >
49100 MB is good).  The output will look something like this:
50
51  connecting to 127.0.0.1 port 80
52  tput 21414
53  tput 25054
54  tput 25473
55  tput 13086
56  tput 22462
57  tput 110
58  tput 25104
59  tput 23306
60  tput 25026
61  tput 25067
62  tput 25453
63  tput 22296
64  tput 25709
65  tput 25394
66  tput 25141
67  tput 23719
68  tput 24419
69  tput 25089
70  tput 25459
71  tput 23715
72  tput 24156
73  tput 25413
74  tput 24975
75  tput 23840
76  tput 24563
77  tput 25072
78  tput 25451
79  [...]
80
81This is from my external firewire hard disk over the loopback interface.
82There will be one tput line per megabyte downloaded.  The number is
831000000000 divided by the number of ?sec it took to download this
84megabyte, i.e. the average number of kilobytes per second.
85
86

README.manymapbench

1manymapbench will mmap the first page of many small files.  This is what
2mmapbench was supposed to approximate, but I am told that it does not,
3but it triggers the worst case of an optimization in the BSD VM instead.
4
5You are supposed to create the data by running ./mktestdata instead,
6with the same -c argument.  Please note that manymapbench does not prime
7the cache first, so please run it twice and disregard the output of the
8first run.
9
10manymapbench will output three numbers in each line, for example
11
12  6753 2338 3094
13
14The first number is the latency for opening the file (probably not
15useful, but measuring it does not cost anything).  The second number is
16the latency for mmapping the page.  The third number is the latency for
17reading one byte on the page (which ought to trigger a page fault unless
18the VM reads the page anyway if it encompasses the whole file, which
19Linux 2.6 does, judging from the number in this example).
20
21On i386, manymapbench will read the task cycle counter instead of
22gettimeofday and give the results in CPU cycles, not usec.  You can
23divide the numbers by the CPU frequency to get comparable numbers.  As
24there is no portable way to get the CPU frequency, manymapbench does not
25even pretend to do this.
26

README.mmapbench

1mmapbench will take one file as argument on the command line.
2It will then map ever second page of the file, "count" times.
3count is 25000 per default, (i.e. 100 megs are mapped, the file needs to
4be at least 200 megs large).
5
6The program will then prime the cache and read a few bytes from every
7page that is mmapped later on, to make sure the pages are in the buffer
8cache.
9
10mmapbench will then mmap every other page and measure the latency of
11that, and it will then read a byte of the page, which should force a
12page fault in the OS and cause the OS to actually map the page to
13memory.
14
15On i386, mmapbench will read the task cycle counter instead of
16gettimeofday and give the results in CPU cycles, not usec.  You can
17divide the numbers by the CPU frequency to get comparable numbers.  As
18there is no portable way to get the CPU frequency, mmapbench does not
19even pretend to do this.
20
21NOTE: if you get a bus error, you gave too small a file as argument.
22The default settings from run-bench assume a file (or block device!) at
23least 160 MB.  So the easiest way is to just point mmapbench to your
24root partition, or use dd to create a large new file.
25

README.performance

1gatling uses the io and iob interfaces from libowfat and thus exploits
2OS specific performance hacks on the following operating systems:
3
4  Linux 2.4:
5    O(1) event notification scalability through sigio
6    zero-copy TCP via sendfile
7
8  Linux 2.6:
9    O(1) event notification scalability through epoll
10    zero-copy TCP via sendfile
11
12  FreeBSD 4 and 5:
13    O(1) event notification scalability through kqueue
14    zero-copy TCP via sendfile
15
16  NetBSD 2:
17    O(1) event notification scalability through kqueue
18    zero-copy TCP via mmap+write
19
20  OpenBSD 3.4:
21    They have kqueue, but it's not O(1)
22    They don't have sendfile, and to my knowledge their mmap+write is
23      not zero-copy
24
25  HP-UX 11:
26    There were rumours of /dev/poll, but my test box didn't have it.
27    So we have O(n) event notification scalability through poll(2)
28    zero-copy TCP via sendfile
29
30  IRIX 6.5:
31    O(1) event notification scalability through /dev/poll
32    Rumour has it that mmap+write is zero-copy in IRIX.
33    I have no way of knowing, though
34
35  Solaris 9:
36    O(1) event notification scalability through /dev/poll
37    zero-copy TCP via sendfile
38
39  MacOS X:
40    Uses kqueue, but I haven't benchmarked it yet to see if it's O(1)
41    the headers in panther declare sendfile (protected with #if SENDFILE
42    (not #ifdef, #if!)), but libc doesn't have it, and neither does any
43    other library.
44
45  AIX:
46    AIX 5 has send_file.  I am not aware of any way to speed up poll on
47    AIX.
48

README.php

1gatling now supports SCGI and FastCGI and can thus be used to run, for
2example, PHP scripts.
3
4Here's how to use it.
5
6  1. compile gatling with proxy mode (this is on by default).
7  2. enable proxying for the virtual host you want to use:
8
9       $ touch www.example.com:80/.proxy
10
11  3. run php in FastCGI mode (adjust path to PHP as needed):
12
13       $ PHP_FCGI_CHILDREN=16 /opt/php/bin/php-cgi -b 127.0.0.1:8001
14
15  4. tell gatling to use this to run the PHP scripts:
16
17       # gatling -O 'F/127.0.0.1/8001/\.php'
18
19  5. now, you should be able to browse to
20
21     http://www.example.com/t.php
22
23Note that the physical t.php file must exist in your http root.  gatling
24checks if it's there and tells php to parse it from there.  This file
25needs to be there but it does not need to be world readable.  Gatling
26will only serve files that are world readable.  It is thus a good idea
27to make the php files only readable to the user or group php runs under,
28and not to the world.  That way you cannot accidentally serve them via
29gatling.  The same trick goes for include files or other files that the
30php scripts may want to read but that do not need to be served by
31gatling directly.
32

README.polarssl

1PolarSSL is a small SSL/TLS library suitable for embedded use.
2You can find it at http://www.polarssl.org/
3
4At the time of this writing (August 2011), the author has added several
5patches I suggested in the SVN trunk version, so you need the trunk
6version.
7
8To compile polarssl with dietlibc, just go to polarssl/library and do
9this:
10
11  $ diet -Os gcc -nostdinc -c *.c -I ../include
12  $ ar rsu libpolarssl.a *.o
13  $ cp libpolarssl.a `diet -L gcc`
14  $ mkdir -p /opt/diet/include/polarssl
15  $ cp -p ../include/polarssl/*.h /opt/diet/include/polarssl
16
17After that, in the gatling source tree, run
18
19  $ make ptlsgatling
20
21polarssl support is only lightly tested and should be considered
22experimental.  However, here is why you might want to check it out:
23
24-rwxr-xr-x    1 leitner  users      165944 Aug 19 02:57 gatling
25-rwxr-xr-x    1 leitner  users     1258176 Aug 19 02:57 tlsgatling
26-rwxr-xr-x    1 leitner  users      384584 Aug 19 02:57 ptlsgatling
27

README.prefetch

1gatling now has experimental prefetching support.
2The code is experimental and enabled per default, disable it with -P0.
3
4The code is only used for downloads larger than 1 MB.  What it does it
5mmap and read the next n MB in the file.  Set the value with -P 2M (for
62 MB) or -P 1G (for 1 GB).  Useful range would be (depending on your
7RAM and hard disk speed) 1 MB until maybe 10 MB.  The idea is that
8modern disks are very fast (50 MB/sec) for linear reading (so
9downloading one file is very fast) but they are very slow for moving the
10read head (so two people downlading two ISO images is very slow because
11the read head is always moving from image A to image B and reading a few
12kilobytes).  Normally, the OS should do prefetching, in particular if we
13use sendfile (which we do), but I have yet to see an OS that does.  The
14solution would be to read larger parts of the file before sending it.
15gatling mmaps the files, reads two megabytes (or whatever you
16configured), which then stay in the OS buffer cache.  This ought to
17reduce head movement.
18
19
20Please note: since gatling is not threaded, no requests will be
21services while gatling is prefetching data.  So if you set the prefetch
22too big, gatling will stall during the prefetches.  If you set the
23prefetch too small, the OS internal prefetching will prefetch more than
24gatling does and thus there will be no effect.  If you serve data from
25many different disks of different speed, set the prefetch to a value
26that is good for the _slowest_ disk of the pack.
27
28
29NB: prefetching does not help AT ALL if your files are fragmented on
30disk.  This usually happens if you downloaded them with some P2P
31application or download manager (BitTorrent 3.3 has some counter
32measures here and should be safe).  I'll include the readfrag program
33which you can use to defragment files (it will output the file on
34stdout, if stdout is a terminal, it will just say how much head movement
35it could save compared to a naive OS; Linux 2.6's internal disk I/O
36scheduler is good enough so you can just use cp instead of readfrag).
37readfrag uses a little documented Linux specific ioctl that is used by
38LILO (the boot loader) normally; if you know how to port this to other
39OSes, please tell me.
40

README.proxy

1gatling has primitive CGI support which is implemented as a proxy.
2
3The idea is that you specify a regex and an ip and a port.  If the regex
4matches the requested URL, gatling will not answer the query itself but
5make a TCP connection to the ip and the port.  So, in effect, gatling
6can be used to quickly serve static data but let someone else (an Apache
7maybe) serve the Java servlets.
8
9In my tests I used fnord as backend to run a CGI program.  This ought to
10combine the best of all worlds.
11
12For testing, run gatling like this:
13
14  ./gatling -O 127.0.0.1/8023/cgi$
15
16And then run fnord in the same directory like this:
17
18  tcpserver -v -u `id -u nobody` -RHl localhost 0 8023 fnord-cgi
19
20Another idea I have is to not relay the requests synchronously but
21through a request pool.  If there are more requests than slots in the
22pool, gatling could prioritize the requests through an external program.
23My current idea is that gatling would run an external program (think:
24perl) that would get peer IP address and HTTP request on stdin and write
25a priority on stdout.
26
27You can have more than one -O statement.  The first matching will always
28be used.  So you can have one backend for .jsp and a different one for
29.cgi.
30
31This CGI proxy mode will only be used if the file ".proxy" exists in the
32root of the virtual server.
33

README.redirect

1gatling can do HTTP redirects.
2
3To do it, create a symlink like this:
4
5  $ ln -s http://www.google.com/ search.html
6
7Then, if someone tries to access search.html via HTTP, gatling will
8detect the special broken symlink and send the user a HTTP redirect to
9www.google.com.
10
11To redirect an URL ending in /, create that directory and create a
12symlink as above for index.html.
13
14
15
16UPDATE: gatling can now also do fallback redirects.  If you have a farm
17of mirrors, all replicating off a central one, you can tell gatling to
18not generate 404s on the mirrors, but redirects.
19SUPPORT_FALLBACK_REDIRECT must be #defined in gatling.c for this to be
20compiled in.
21
22If, for example, you run on your mirror machine
23
24  gatling -r http://fallback.example.com
25
26and someone requests
27
28  http://mirror.example.com/notyetuploaded.html
29
30gatling will generate a temporary redirect to
31
32  http://fallback.example.com/notyetuploaded.html
33

README.tls

1gatling now has primitive SSL/TLS support using OpenSSL.
2I took the code from the excellent qmail STARTTLS patch.
3No support for much of anything yet, you just get an HTTPS server
4using the certificate in "server.pem" in the gatling root directory.
5
6If you want OpenSSL to verify client certs, put the CA cert in
7"clientca.pem".  If you need a revocation list, use OpenSSL 0.9.7 or
8later, and put it in "clientcrl.pem".
9
10No way to communicate anything about the client cert to CGIs yet.
11
12
13As of Sep 23 2008 gatling has support for ssh passthrough.  The idea is
14the following.  Let's assume you run a server somewhere, and you want to
15SSH to it, but you only get internet access through some restrictive
16proxy firewall that lets you connect to port 443 because that's what
17HTTPS uses.  So you bind a ssh to port 443 on your server.  Now you
18want to run an SSL webserver, too.  It turns out, you can do both!
19For TLS, the client connects and writes something.  For SSH, the client
20connects and expects the server to write something.  So, gatling can
21accept the connection, attempt an SSL handshake, but if the client does
22not write anything for a few seconds, you pass the descriptor on to sshd
23running in inetd mode.  That way, you can transparently use both SSL and
24SSH on the same port.  You still risk losing SSL connections that come
25from very slow connections, so this is not enabled by default.  To
26enable it, run tlsgatling with
27
28  -X "2,/opt/diet/sbin/sshd -u0"
29
30where -X is the option to enable this, 2 is the timeout in seconds, and
31the rest after the comma is the sshd command line you want gatling to
32run.  Note that gatling auto-appends the -i option to this command line,
33so you do not need to specify it here.
34
35PLEASE NOTE: if you are planning to run gatling with SSL in chroot mode,
36you need to make sure the needed files (by the SSL library) are there.
37For example, for openssl, there needs to be a /dev/urandom inside the
38chroot jail.  Typical error message:
39
40  ssl_handshake_error 8 error:140B512D:SSL routines:SSL_GET_NEW_SESSION:ssl session id callback failed
41
42
43
44
45UPDATE 2013-07-01: gatling now supports ephemeral Diffie Hellman to
46enable Perfect Forward Secrecy.  This, in a nutshell, means that if
47someone steals or subpoenas your server to obtain your secret key, they
48can still not decrypt any previous data transfers because those used
49ephemeral (temporary) keys.  Hint: YOU WANT THIS.  The downside is that
50it uses up more CPU time.
51
52You need to do two things to get this to work.  First, generate some
53Diffie Hellman parameters, like so:
54
55  openssl gendh -out dhparams.pem -rand - 2048
56
57Append the resulting dhparams.pem to your server.pem file at the end, or
58store them in a file called dhparams.pem in the same directory as
59server.pem.
60
61Please note that you should also set the OpenSSL ciphers.  As of
6220130907 gatling will do this for you if you don't.  The set gatling
63uses is
64
65  HIGH:!DSS:!RC4:!MD5:!aNULL:!eNULL:@STRENGTH
66
67Note: As of 20140101 gatling is hard-coded to not allow SSLv2 or SSLv3,
68only TLS 1.0 and up.
69
70This cipher string means: Use TLSv1 ciphers with high grade encryption,
71do not allow SSLv2 or SSLv3, insist on TLSv1 or better, do not allow cipher
72suites without authentication or encryption, and sort by strength so the
73strongest common suite between client and server gets selected.
74
75Note that this contains a compromise.  It still allows cipher suites
76without perfect forward secrecy.  This means that if somebody steals the
77secret key from your server, they can decrypt all earlier intercepted
78transmissions that did not have perfect forward secrecy enabled.
79
80You can set ciphers via the environment before running tlsgatling:
81
82  TLSCIPHERS='HIGH:!aNULL:!eNULL:@STRENGTH' tlsgatling [arguments]
83
84If you are using minit and serdo, put this in your script file before
85running tlsgatling:
86
87  export TLSCIPHERS=HIGH:!aNULL:!eNULL:@STRENGTH
88
89If you don't want two files lying around, you can also append the
90contents of dhparams.pem to your server.pem; gatling will also look
91there.
92
93UPDATE 2013-09-07: gatling now defaults to good cipher suites and will
94specify a dhparams for you if you don't.  The Diffie Hellman parameters
95are not a secret key and no harm ought to come from using the ones
96gatling comes with, but it will probably still make you feel better if
97you generate your own.
98
99NOTE: If you use a site like ssllabs.com, it will give you a false
100positive warning that is not actually true.  It says that the server
101does not mitigate the BEAST attack.  If your version of OpenSSL is
102current, this is flat out not true.
103
104UPDATE 2014-07-15: The SSL initialization code will now abort if
105/dev/urandom can't be opened for reading.  It is a common mistake to
106forget to have /dev/urandom in chroot mode (-C option in gatling), and
107in that case randomness could be impaired.
108
109
110UPDATE 2014-10-03: The OpenSSL code now supports SNI. Clients supporting
111SNI send the name of the server they are trying to reach as part of the
112initial handshake.  OpenSSL can than give gatling a callback, which will
113attempt to load the key specified in the handshake.  For example, for
114https://localhost/, gatling would attempt to load server.pem (the
115default key) and then via SNI callback localhost.pem.  All modern
116browsers support it (on Windows you need Vista or newer for IE/Chrome).
117