# Adding SSL support to NCSA HTTPD version 1.3

H1: NCSA HTTPD

The aim was to have a replacement for the {{Netscape commerce server}}
that with the simple addition of a key would be able to server {{Netscape}}
clients. The patches to {{NCSA Mosaic}} were done such that it can
talk to this server.

Still to do is the work for a {{SSL}} pipe to {{CGI}} interface ... at
the moment we have not done that block of work (other time pressures) 
which simply involves an extra process acting as a filter for the
{{SSL}} encoded I/O.

:Note: cgi's are mostly working now ... still have to track down a bug
in handling submission of forms, but activation of cgi scripts seems
okay.

The {{httpd}} stuff was a little messy as the I/O is done in multiple different
locations and involved lots of printf's so I cut a printf wrapper (which
is in {{ssl/ssl_trc.c}} to make life a little easy and the code more 
maintainable. This wrapper really should be put into {{httpd}} and the I/O
restructured to go though a single point however that will take more
time than is available at the moment.

H2: Makefile

Usual changes for {{SSL}}

H2: httpd.c

Command line option addition {{-z ssl}}

E: -z ssl
E: -z debug
E: -z verify=INT 
E: -z cert=filename
E: -z key=filename
#E: -z secure
E: -z standalone        # run standalone for a single request 
E:                      # which is very useful for debugging

:Note: this means that to run {{http}} in a mode that will offer {{https}}
services you {{B:must}} start {{httpd}} with the {{-z ssl}} option.

H2: httpd.h

Added {{DEFAULT_SSL_POR}} of {{443}} and defined the global state
variables. Also the macro {{FPRINTF}} for the {{SSL}} version of
{{fprintf}} was added to make "porting" easier.

H2: http_config.c

Set the port to {{DEFAULT_SSL_PORT}} rather than {{DEFAULT_PORT}} if
we are running as a {{SSL}} {{HTTPS}} server.

H2: http_log.c

Catch heaps of fprintf's

H2: http_mime.c

Catch some fprintf's

H2: http_request.c

Initial {{SSL}} connection negotiation added here ... also had to 
trap the write sequence in {{send_fd()}}.

H2: util.c

Changed {{getline()}} to support {{SSL}}

