RewriteRule ^net.sw$ net.sw/ [R]
@@ -413,7 +414,7 @@ RewriteRule ^net.sw/(.*)$ e/netsw/$1
The first rule is for requests which miss the trailing slash! The second rule
does the real thing. And then comes the killer configuration which stays in
-the per-directory config file /e/netsw/.www/.wwwacl:
+the per-directory config file /e/netsw/.www/.wwwacl :
Options ExecCGI FollowSymLinks Includes MultiViews
@@ -467,11 +468,11 @@ Some hints for interpretation:
When switching from the NCSA webserver to the more modern Apache webserver a
lot of people want a smooth transition. So they want pages which use their old
-NCSA imagemap program to work under Apache with the modern
-mod_imap. The problem is that there are a lot of
-hyperlinks around which reference the imagemap program via
-/cgi-bin/imagemap/path/to/page.map. Under Apache this
-has to read just /path/to/page.map.
+NCSA imagemap program to work under Apache with the modern
+mod_imap . The problem is that there are a lot of
+hyperlinks around which reference the imagemap program via
+/cgi-bin/imagemap/path/to/page.map . Under Apache this
+has to read just /path/to/page.map .
Solution:
@@ -505,13 +506,13 @@ RewriteEngine on
# first try to find it in custom/...
# ...and if found stop and be happy:
-RewriteCond /your/docroot/dir1/%{REQUEST_FILENAME} -f
-RewriteRule ^(.+) /your/docroot/dir1/$1 [L]
+RewriteCond /your/docroot/dir1/%{REQUEST_FILENAME} -f
+RewriteRule ^(.+) /your/docroot/dir1/$1 [L]
# second try to find it in pub/...
# ...and if found stop and be happy:
-RewriteCond /your/docroot/dir2/%{REQUEST_FILENAME} -f
-RewriteRule ^(.+) /your/docroot/dir2/$1 [L]
+RewriteCond /your/docroot/dir2/%{REQUEST_FILENAME} -f
+RewriteRule ^(.+) /your/docroot/dir2/$1 [L]
# else go on for other Alias or ScriptAlias directives,
# etc.
@@ -536,13 +537,13 @@ strip out this information.
We use a rewrite rule to strip out the status information and remember it via
an environment variable which can be later dereferenced from within XSSI or
-CGI. This way a URL /foo/S=java/bar/ gets translated to
-/foo/bar/ and the environment variable named STATUS is set
+CGI. This way a URL /foo/S=java/bar/ gets translated to
+/foo/bar/ and the environment variable named STATUS is set
to the value "java".
RewriteEngine on
-RewriteRule ^(.*)/S=([^/]+)/(.*) $1/$3 [E=STATUS:$2]
+RewriteRule ^(.*)/S=([^/]+)/(.*) $1/$3 [E=STATUS:$2]
|
@@ -554,7 +555,7 @@ RewriteRule ^(.*)/S=([^/]+)/(.*) $1/$3 [E=STATUS:$2]
- Description:
-
-Assume that you want to provide www.username.host.domain.com
+Assume that you want to provide
www.username.host.domain.com
for the homepage of username via just DNS A records to the same machine and
without any virtualhosts on this machine.
@@ -563,14 +564,14 @@ without any virtualhosts on this machine.
-
For HTTP/1.0 requests there is no solution, but for HTTP/1.1 requests which
contain a Host: HTTP header we can use the following ruleset to rewrite
-http://www.username.host.com/anypath internally to
-/home/username/anypath:
+
http://www.username.host.com/anypath internally to
+/home/username/anypath :
RewriteEngine on
-RewriteCond %{HTTP_HOST} ^www\.[^.]+\.host\.com$
+RewriteCond %{HTTP_HOST} ^www\.[^.]+\.host\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
-RewriteRule ^www\.([^.]+)\.host\.com(.*) /home/$1$2
+RewriteRule ^www\.([^.]+)\.host\.com(.*) /home/$1$2
|
@@ -583,8 +584,8 @@ RewriteRule ^www\.([^.]+)\.host\.com(.*) /home/$1$2
Description:
We want to redirect homedir URLs to another webserver
-www.somewhere.com when the requesting user does not stay in the local
-domain ourdomain.com. This is sometimes used in virtual host
+www.somewhere.com when the requesting user does not stay in the local
+domain ourdomain.com . This is sometimes used in virtual host
contexts.
@@ -594,7 +595,7 @@ Just a rewrite condition:
RewriteEngine on
-RewriteCond %{REMOTE_HOST} !^.+\.ourdomain\.com$
+RewriteCond %{REMOTE_HOST} !^.+\.ourdomain\.com$
RewriteRule ^(/~.+) http://www.somewhere.com/$1 [R,L]
|
@@ -620,8 +621,8 @@ error safe:
RewriteEngine on
-RewriteCond /your/docroot/%{REQUEST_FILENAME} !-f
-RewriteRule ^(.+) http://webserverB.dom/$1
+RewriteCond /your/docroot/%{REQUEST_FILENAME} !-f
+RewriteRule ^(.+) http://webserverB.dom/$1
|
@@ -631,8 +632,8 @@ homedirs, etc.) there is better variant:
RewriteEngine on
-RewriteCond %{REQUEST_URI} !-U
-RewriteRule ^(.+) http://webserverB.dom/$1
+RewriteCond %{REQUEST_URI} !-U
+RewriteRule ^(.+) http://webserverB.dom/$1
|
@@ -663,7 +664,7 @@ also escape the hash character. How can we redirect to such a URL?
We have to use a kludge by the use of a NPH-CGI script which does the redirect
itself. Because here no escaping is done (NPH=non-parseable headers). First
-we introduce a new URL scheme xredirect: by the following per-server
+we introduce a new URL scheme xredirect: by the following per-server
config-line (should be one of the last rewrite rules):
@@ -672,8 +673,8 @@ RewriteRule ^xredirect:(.+) /path/to/nph-xredirect.cgi/$1 \
|
-This forces all URLs prefixed with xredirect: to be piped through the
-nph-xredirect.cgi program. And this program just looks like:
+This forces all URLs prefixed with xredirect: to be piped through the
+nph-xredirect.cgi program. And this program just looks like:
@@ -697,7 +698,7 @@ print "<title>302 Moved Temporarily (EXTENDED)</title>\n";
print "</head>\n";
print "<body>\n";
print "<h1>Moved Temporarily (EXTENDED)</h1>\n";
-print "The document has moved <a href=\"$url\">here</a>.<p>\n";
+print "The document has moved <a HREF=\"$url\">here</a>.<p>\n";
print "</body>\n";
print "</html>\n";
@@ -708,7 +709,7 @@ print "</html>\n";
This provides you with the functionality to do redirects to all URL schemes,
i.e. including the one which are not directly accepted by mod_rewrite. For
-instance you can now also redirect to news:newsgroup via
+instance you can now also redirect to news:newsgroup via
RewriteRule ^anyurl xredirect:news:newsgroup
@@ -716,7 +717,7 @@ RewriteRule ^anyurl xredirect:news:newsgroup
Notice: You have not to put [R] or [R,L] to the above rule because the
-xredirect: need to be expanded later by our special "pipe through"
+xredirect: need to be expanded later by our special "pipe through"
rule above.
@@ -728,8 +729,8 @@ rule above.
- Description:
-
-Do you know the great CPAN (Comprehensive Perl Archive Network) under http://www.perl.com/CPAN? This does a
+Do you know the great CPAN (Comprehensive Perl Archive Network) under http://www.perl.com/CPAN? This does a
redirect to one of several FTP servers around the world which carry a CPAN
mirror and is approximately near the location of the requesting client.
Actually this can be called an FTP access multiplexing service. While CPAN
@@ -747,7 +748,7 @@ ruleset we can use this top-level domain as a key to our multiplexing map.
RewriteEngine on
RewriteMap multiplex txt:/path/to/map.cxan
RewriteRule ^/CxAN/(.*) %{REMOTE_HOST}::$1 [C]
-RewriteRule ^.+\.([a-zA-Z]+)::(.*)$ ${multiplex:$1|ftp.default.dom}$2 [R,L]
+RewriteRule ^.+\.([a-zA-Z]+)::(.*)$ ${multiplex:$1|ftp.default.dom}$2 [R,L]
|
@@ -778,7 +779,7 @@ How can it be done via mod_rewrite?
Solution:
-There are a lot of variables named TIME_xxx for rewrite conditions.
+There are a lot of variables named TIME_xxx for rewrite conditions.
In conjunction with the special lexicographic comparison patterns <STRING,
>STRING and =STRING we can do time-dependend redirects:
@@ -791,9 +792,9 @@ RewriteRule ^foo\.html$ foo.night.html
|
-This provides the content of foo.day.html under the URL
-foo.html from 07:00-19:00 and at the remaining time the contents of
-foo.night.html. Just a nice feature for a homepage...
+This provides the content of foo.day.html under the URL
+foo.html from 07:00-19:00 and at the remaining time the contents of
+foo.night.html . Just a nice feature for a homepage...
@@ -843,8 +844,8 @@ RewriteRule ^(.*)$ $1.html
- Description:
-
-Assume we have recently renamed the page bar.html to
-foo.html and now want to provide the old URL for backward
+Assume we have recently renamed the page
bar.html to
+foo.html and now want to provide the old URL for backward
compatibility. Actually we want that users of the old URL even not recognize
that the pages was renamed.
@@ -856,7 +857,7 @@ We rewrite the old URL to the new one internally via the following rule:
RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^foo\.html$ bar.html
+RewriteRule ^foo\.html$ bar.html
|
@@ -868,8 +869,8 @@ RewriteRule ^foo\.html$ bar.html
- Description:
-
-Assume again that we have recently renamed the page bar.html to
-foo.html and now want to provide the old URL for backward
+Assume again that we have recently renamed the page
bar.html to
+foo.html and now want to provide the old URL for backward
compatibility. But this time we want that the users of the old URL get hinted
to the new one, i.e. their browsers Location field should change, too.
@@ -882,7 +883,7 @@ browsers and thus the users view:
RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^foo\.html$ bar.html [R]
+RewriteRule ^foo\.html$ bar.html [R]
|
@@ -905,21 +906,21 @@ browsers and a average feature version for all others.
We cannot use content negotiation because the browsers do not provide their
type in that form. Instead we have to act on the HTTP header "User-Agent".
The following condig does the following: If the HTTP header "User-Agent"
-begins with "Mozilla/3", the page foo.html is rewritten to
-foo.NS.html and and the rewriting stops. If the browser is "Lynx" or
-"Mozilla" of version 1 or 2 the URL becomes foo.20.html. All other
-browsers receive page foo.32.html. This is done by the following
+begins with "Mozilla/3", the page foo.html is rewritten to
+foo.NS.html and and the rewriting stops. If the browser is "Lynx" or
+"Mozilla" of version 1 or 2 the URL becomes foo.20.html . All other
+browsers receive page foo.32.html . This is done by the following
ruleset:
-RewriteCond %{HTTP_USER_AGENT} ^Mozilla/3.*
-RewriteRule ^foo\.html$ foo.NS.html [L]
+RewriteCond %{HTTP_USER_AGENT} ^Mozilla/3.*
+RewriteRule ^foo\.html$ foo.NS.html [L]
-RewriteCond %{HTTP_USER_AGENT} ^Lynx/.* [OR]
-RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[12].*
-RewriteRule ^foo\.html$ foo.20.html [L]
+RewriteCond %{HTTP_USER_AGENT} ^Lynx/.* [OR]
+RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[12].*
+RewriteRule ^foo\.html$ foo.20.html [L]
-RewriteRule ^foo\.html$ foo.32.html [L]
+RewriteRule ^foo\.html$ foo.32.html [L]
|
@@ -932,9 +933,9 @@ RewriteRule ^foo\.html$ foo.32.html [L]
Description:
Assume there are nice webpages on remote hosts we want to bring into our
-namespace. For FTP servers we would use the mirror program which
+namespace. For FTP servers we would use the mirror program which
actually maintains an explicit up-to-date copy of the remote data on the local
-machine. For a webserver we could use the program webcopy which acts
+machine. For a webserver we could use the program webcopy which acts
similar via HTTP. But both techniques have one major drawback: The local copy
is always just as up-to-date as often we run the program. It would be much
better if the mirror is not a static one we have to establish explicitly.
@@ -951,13 +952,13 @@ webarea to our namespace by the use of the Proxy Throughput feature
RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^hotsheet/(.*)$ http://www.tstimpreso.com/hotsheet/$1 [P]
+RewriteRule ^hotsheet/(.*)$ http://www.tstimpreso.com/hotsheet/$1 [P]
|
RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^usa-news\.html$ http://www.quux-corp.com/news/index.html [P]
+RewriteRule ^usa-news\.html$ http://www.quux-corp.com/news/index.html [P]
|
@@ -991,9 +992,9 @@ RewriteRule ^http://www\.remotesite\.com/(.*)$ /mirror/of/remotesite/$1
Description:
This is a tricky way of virtually running a corporates (external) Internet
-webserver (www.quux-corp.dom), while actually keeping and maintaining
+webserver (www.quux-corp.dom ), while actually keeping and maintaining
its data on a (internal) Intranet webserver
-(www2.quux-corp.dom) which is protected by a firewall. The
+(www2.quux-corp.dom ) which is protected by a firewall. The
trick is that on the external webserver we retrieve the requested data
on-the-fly from the internal one.
@@ -1006,8 +1007,8 @@ from it. For a packet-filtering firewall we could for instance configure a
firewall ruleset like the following:
-ALLOW Host www.quux-corp.dom Port >1024 --> Host www2.quux-corp.dom Port 80
-DENY Host * Port * --> Host www2.quux-corp.dom Port 80
+ALLOW Host www.quux-corp.dom Port >1024 --> Host www2.quux-corp.dom Port 80
+DENY Host * Port * --> Host www2.quux-corp.dom Port 80
|
@@ -1017,9 +1018,9 @@ proxy throughput feature:
RewriteRule ^/~([^/]+)/?(.*) /home/$1/.www/$2
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteCond %{REQUEST_FILENAME} !-d
-RewriteRule ^/home/([^/]+)/.www/?(.*) http://www2.quux-corp.dom/~$1/pub/$2 [P]
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^/home/([^/]+)/.www/?(.*) http://www2.quux-corp.dom/~$1/pub/$2 [P]
|
@@ -1031,8 +1032,8 @@ RewriteRule ^/home/([^/]+)/.www/?(.*) http://www2.quux-corp.dom/~$1/pub/$
- Description:
-
-Suppose we want to load balance the traffic to www.foo.com over
-www[0-5].foo.com (a total of 6 servers). How can this be done?
+Suppose we want to load balance the traffic to
www.foo.com over
+www[0-5].foo.com (a total of 6 servers). How can this be done?
- Solution:
@@ -1041,11 +1042,11 @@ There are a lot of possible solutions for this problem. We will discuss first
a commonly known DNS-based variant and then the special one with mod_rewrite:
-- DNS Round-Robin
+
- DNS Round-Robin
The simplest method for load-balancing is to use the DNS round-robin feature
-of BIND. Here you just configure www[0-9].foo.com as usual in your
+of BIND. Here you just configure www[0-9].foo.com as usual in your
DNS with A(address) records, e.g.
@@ -1072,33 +1073,33 @@ www IN CNAME www0.foo.com.
Notice that this seems wrong, but is actually an intended feature of BIND and
-can be used in this way. However, now when www.foo.com gets resolved,
-BIND gives out www0-www6 - but in a slightly permutated/rotated order
+can be used in this way. However, now when www.foo.com gets resolved,
+BIND gives out www0-www6 - but in a slightly permutated/rotated order
every time. This way the clients are spread over the various servers.
But notice that this not a perfect load balancing scheme, because DNS resolve
information gets cached by the other nameservers on the net, so once a client
-has resolved www.foo.com to a particular wwwN.foo.com, all
-subsequent requests also go to this particular name wwwN.foo.com. But
+has resolved www.foo.com to a particular wwwN.foo.com , all
+subsequent requests also go to this particular name wwwN.foo.com . But
the final result is ok, because the total sum of the requests are really
spread over the various webservers.
- - DNS Load-Balancing
+
- DNS Load-Balancing
A sophisticated DNS-based method for load-balancing is to use the program
-lbnamed which can be found at http://www.stanford.edu/~schemers/docs/lbnamed/lbnamed.html.
+lbnamed which can be found at http://www.stanford.edu/~schemers/docs/lbnamed/lbnamed.html.
It is a Perl 5 program in conjunction with auxilliary tools which provides a
real load-balancing for DNS.
- - Proxy Throughput Round-Robin
+
- Proxy Throughput Round-Robin
In this variant we use mod_rewrite and its proxy throughput feature. First we
-dedicate www0.foo.com to be actually www.foo.com by using a
+dedicate www0.foo.com to be actually www.foo.com by using a
single
@@ -1106,11 +1107,11 @@ www IN CNAME www0.foo.com.
|
-entry in the DNS. Then we convert www0.foo.com to a proxy-only
+entry in the DNS. Then we convert www0.foo.com to a proxy-only
server, i.e. we configure this machine so all arriving URLs are just pushed
-through the internal proxy to one of the 5 other servers (www1-www5).
+through the internal proxy to one of the 5 other servers (www1-www5 ).
To accomplish this we first establish a ruleset which contacts a load
-balancing script lb.pl for all URLs.
+balancing script lb.pl for all URLs.
RewriteEngine on
@@ -1119,7 +1120,7 @@ RewriteRule ^/(.+)$ ${lb:$1} [P,L]
|
-Then we write lb.pl:
+Then we write lb.pl :
#!/path/to/perl
@@ -1145,13 +1146,13 @@ while (<STDIN>) {
|
-A last notice: Why is this useful? Seems like www0.foo.com still is
+A last notice: Why is this useful? Seems like www0.foo.com still is
overloaded? The answer is yes, it is overloaded, but with plain proxy
throughput requests, only! All SSI, CGI, ePerl, etc. processing is completely
done on the other machines. This is the essential point.
- - Hardware/TCP Round-Robin
+
- Hardware/TCP Round-Robin
There is a hardware solution available, too. Cisco has a beast called
@@ -1291,34 +1292,34 @@ boring, so a lot of webmaster don't use them. Even Apache's Action handler
feature for MIME-types is only appropriate when the CGI programs don't need
special URLs (actually PATH_INFO and QUERY_STRINGS) as their input.
-First, let us configure a new file type with extension .scgi
-(for secure CGI) which will be processed by the popular cgiwrap
+First, let us configure a new file type with extension .scgi
+(for secure CGI) which will be processed by the popular cgiwrap
program. The problem here is that for instance we use a Homogeneous URL Layout
(see above) a file inside the user homedirs has the URL
-/u/user/foo/bar.scgi. But cgiwrap needs the URL in the form
-/~user/foo/bar.scgi/. The following rule solves the problem:
+/u/user/foo/bar.scgi . But cgiwrap needs the URL in the form
+/~user/foo/bar.scgi/ . The following rule solves the problem:
-RewriteRule ^/[uge]/([^/]+)/\.www/(.+)\.scgi(.*) ...
-... /internal/cgi/user/cgiwrap/~$1/$2.scgi$3 [NS,T=application/x-http-cgi]
+RewriteRule ^/[uge]/([^/]+)/\.www/(.+)\.scgi(.*) ...
+... /internal/cgi/user/cgiwrap/~$1/$2.scgi$3 [NS,T=application/x-http-cgi]
|
Or assume we have some more nifty programs:
-wwwlog (which displays the access.log for a URL subtree and
-wwwidx (which runs Glimpse on a URL subtree). We have to
+wwwlog (which displays the access.log for a URL subtree and
+wwwidx (which runs Glimpse on a URL subtree). We have to
provide the URL area to these programs so they know on which area
they have to act on. But usually this ugly, because they are all the
times still requested from that areas, i.e. typically we would run
-the swwidx program from within /u/user/foo/ via
+the swwidx program from within /u/user/foo/ via
hyperlink to
/internal/cgi/user/swwidx?i=/u/user/foo/
-which is ugly. Because we have to hard-code both the location of the
-area and the location of the CGI inside the hyperlink. When we have to
+which is ugly. Because we have to hard-code both the location of the
+area and the location of the CGI inside the hyperlink. When we have to
reorganise or area, we spend a lot of time changing the various hyperlinks.
@@ -1333,10 +1334,10 @@ RewriteRule ^/([uge])/([^/]+)(/?.*):log /internal/cgi/user/wwwlog?f=/$1/$2$3
|
-Now the hyperlink to search at /u/user/foo/ reads only
+Now the hyperlink to search at /u/user/foo/ reads only
-href="*"
+HREF="*"
which internally gets automatically transformed to
@@ -1346,7 +1347,7 @@ which internally gets automatically transformed to
The same approach leads to an invocation for the access log CGI
-program when the hyperlink :log gets used.
+program when the hyperlink :log gets used.
@@ -1357,21 +1358,21 @@ program when the hyperlink :log gets used.
- Description:
-
-How can we transform a static page foo.html into a dynamic variant
-foo.cgi in a seemless way, i.e. without notice by the browser/user.
+How can we transform a static page
foo.html into a dynamic variant
+foo.cgi in a seemless way, i.e. without notice by the browser/user.
- Solution:
-
We just rewrite the URL to the CGI-script and force the correct MIME-type so
it gets really run as a CGI-script. This way a request to
-/~quux/foo.html internally leads to the invokation of
-/~quux/foo.cgi.
+
/~quux/foo.html internally leads to the invokation of
+/~quux/foo.cgi .
RewriteEngine on
RewriteBase /~quux/
-RewriteRule ^foo\.html$ foo.cgi [T=application/x-httpd-cgi]
+RewriteRule ^foo\.html$ foo.cgi [T=application/x-httpd-cgi]
|
@@ -1384,10 +1385,10 @@ RewriteRule ^foo\.html$ foo.cgi [T=application/x-httpd-cgi
Description:
Here comes a really esoteric feature: Dynamically generated but statically
-served pages, i.e. pages should be delivered as pur static pages (read from
+served pages, i.e. pages should be delivered as pure static pages (read from
the filesystem and just passed through), but they have to be generated
dynamically by the webserver if missing. This way you can have CGI-generated
-pages which are statically unless one (or a cronjob) removes the static
+pages which are statically served unless one (or a cronjob) removes the static
contents. Then the contents gets refreshed.
@@ -1396,18 +1397,18 @@ contents. Then the contents gets refreshed.
This is done via the following ruleset:
-RewriteCond %{REQUEST_FILENAME} !-s
-RewriteCond ^page\.html$ page.cgi [T=application/x-httpd-cgi,L]
+RewriteCond %{REQUEST_FILENAME} !-s
+RewriteRule ^page\.html$ page.cgi [T=application/x-httpd-cgi,L]
|
-Here a request to page.html leads to a internal run of a
-corresponding page.cgi if page.html is still missing or has
-filesize null. The trick here is that page.cgi is a usual CGI script
+Here a request to page.html leads to a internal run of a
+corresponding page.cgi if page.html is still missing or has
+filesize null. The trick here is that page.cgi is a usual CGI script
which (additionally to its STDOUT) writes its output to the file
-page.html. Once it was run, the server sends out the data of
-page.html. When the webmaster wants to force a refresh the contents,
-he just removes page.html (usually done by a cronjob).
+page.html . Once it was run, the server sends out the data of
+page.html . When the webmaster wants to force a refresh the contents,
+he just removes page.html (usually done by a cronjob).
@@ -1427,7 +1428,7 @@ our editor? Impossible?
No! We just combine the MIME multipart feature, the webserver NPH feature and
the URL manipulation power of mod_rewrite. First, we establish a new URL
-feature: Adding just :refresh to any URL causes this to be refreshed
+feature: Adding just :refresh to any URL causes this to be refreshed
every time it gets updated on the filesystem.
@@ -1563,7 +1564,7 @@ exit(0);
- Description:
-
-The <VirtualHost> feature of Apache is nice and works great
+The
<VirtualHost> feature of Apache is nice and works great
when you just have a few dozens virtual hosts. But when you are an ISP and
have hundreds of virtual hosts to provide this feature is not the best choice.
@@ -1646,14 +1647,14 @@ RewriteRule ^/(.*)$ %1/$1 [E=VHOST:${lowercase:%{HTTP_HOST}}]
- Description:
-
How can we block a really annoying robot from retrieving pages of a specific
-webarea? A /robots.txt file containing entries of the "Robot
+webarea? A
/robots.txt file containing entries of the "Robot
Exclusion Protocol" is typically not enough to get rid of such a robot.
- Solution:
-
We use a ruleset which forbids the URLs of the webarea
-/~quux/foo/arc/ (perhaps a very deep directory indexed area where the
+
/~quux/foo/arc/ (perhaps a very deep directory indexed area where the
robot traversal would create big server load). We have to make sure that we
forbid access only to the particular robot, i.e. just forbidding the host
where the robot runs is not enough. This would block users from this host,
@@ -1661,9 +1662,9 @@ too. We accomplish this by also matching the User-Agent HTTP header
information.
-RewriteCond %{HTTP_USER_AGENT} ^NameOfBadRobot.*
-RewriteCond %{REMOTE_ADDR} ^123\.45\.67\.[8-9]$
-RewriteRule ^/~quux/foo/arc/.+ - [F]
+RewriteCond %{HTTP_USER_AGENT} ^NameOfBadRobot.*
+RewriteCond %{REMOTE_ADDR} ^123\.45\.67\.[8-9]$
+RewriteRule ^/~quux/foo/arc/.+ - [F]
|
@@ -1688,15 +1689,15 @@ can at least restrict the cases where the browser sends
a HTTP Referer header.
-RewriteCond %{HTTP_REFERER} !^$
+RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.quux-corp.de/~quux/.*$ [NC]
-RewriteRule .*\.gif$ - [F]
+RewriteRule .*\.gif$ - [F]
|
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !.*/foo-with-gif\.html$
-RewriteRule ^inlined-in-foo\.gif$ - [F]
+RewriteRule ^inlined-in-foo\.gif$ - [F]
|
@@ -1766,19 +1767,19 @@ the Apache proxy?
Solution:
We first have to make sure mod_rewrite is below(!) mod_proxy in the
-Configuration file when compiling the Apache webserver. This way it
+Configuration file when compiling the Apache webserver. This way it
gets called _before_ mod_proxy. Then we configure the following for a
host-dependend deny...
-RewriteCond %{REMOTE_HOST} ^badhost\.mydomain\.com$
+RewriteCond %{REMOTE_HOST} ^badhost\.mydomain\.com$
RewriteRule !^http://[^/.]\.mydomain.com.* - [F]
|
...and this one for a user@host-dependend deny:
-RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} ^badguy@badhost\.mydomain\.com$
+RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} ^badguy@badhost\.mydomain\.com$
RewriteRule !^http://[^/.]\.mydomain.com.* - [F]
|
@@ -1802,9 +1803,9 @@ when using the Basic Auth via mod_access).
We use a list of rewrite conditions to exclude all except our friends:
-RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} !^friend1@client1.quux-corp\.com$
-RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} !^friend2@client2.quux-corp\.com$
-RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} !^friend3@client3.quux-corp\.com$
+RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} !^friend1@client1.quux-corp\.com$
+RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} !^friend2@client2.quux-corp\.com$
+RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} !^friend3@client3.quux-corp\.com$
RewriteRule ^/~quux/only-for-friends/ - [F]
|
@@ -1878,8 +1879,8 @@ to put the resulting (usually rewritten) URL on STDOUT (same order!).
RewriteEngine on
-RewriteMap quux-map prg:/path/to/map.quux.pl
-RewriteRule ^/~quux/(.*)$ /~quux/${quux-map:$1}
+RewriteMap quux-map prg:/path/to/map.quux.pl
+RewriteRule ^/~quux/(.*)$ /~quux/${quux-map:$1}
|
@@ -1899,9 +1900,9 @@ while (<>) {
This is a demonstration-only example and just rewrites all URLs
-/~quux/foo/... to /~quux/bar/.... Actually you can program
-whatever you like. But notice that while such maps can be used also by
-an average user, only the system administrator can define it.
+/~quux/foo/... to /~quux/bar/... . Actually you can program
+whatever you like. But notice that while such maps can be used also by
+an average user, only the system administrator can define it.
diff --git a/usr.sbin/httpd/htdocs/manual/mod/core.html b/usr.sbin/httpd/htdocs/manual/mod/core.html
index fdaedbdbf14..9826fec500e 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/core.html
+++ b/usr.sbin/httpd/htdocs/manual/mod/core.html
@@ -29,6 +29,7 @@ always available.
@@ -448,10 +448,10 @@ config.
-Notice: To disable the logging of rewriting actions it is
+Note: To disable the logging of rewriting actions it is
not recommended to set Filename
to /dev/null , because although the rewriting engine does
-not create output to a logfile it still creates the logfile
+not then output to a logfile it still creates the logfile
output internally. This will slow down the server with no advantage
to the administrator!
To disable logging either remove or comment out the
@@ -514,7 +514,7 @@ RewriteLog "/usr/local/var/apache/logs/rewrite.log"
>Compatibility: Apache 1.2
-The RewriteLogLevel directive set the verbosity level of the
+The RewriteLogLevel directive sets the verbosity level of the
rewriting
logfile. The default level 0 means no logging, while 9 or more means
that practically all actions are logged.
@@ -527,9 +527,8 @@ This disables all rewrite action logs.
Notice: Using a high value for Level will slow down
-your Apache
-server dramatically! Use the rewriting logfile only for debugging or at least
-at Level not greater than 2!
+your Apache server dramatically! Use the rewriting logfile at
+a Level greater than 2 only for debugging!
|
@@ -581,7 +580,7 @@ This directive sets the filename for a synchronization lockfile which
mod_rewrite needs to communicate with RewriteMap
programs. Set this lockfile to a local path (not on a NFS-mounted
device) when you want to use a rewriting map-program. It is not required for
-all other types of rewriting maps.
+other types of rewriting maps.
@@ -640,7 +639,7 @@ When such a construct occurs the map MapName
is consulted and the key LookupKey is looked-up. If the key is
found, the map-function construct is substituted by SubstValue. If
the key is not found then it is substituted by DefaultValue or
-the empty string if no DefaultValue was specified.
+by the empty string if no DefaultValue was specified.
The following combinations for MapType and MapSource
@@ -689,8 +688,8 @@ RewriteMap real-to-user txt:/path/to/file/map.txt
special
post-processing feature: After looking up a value it is parsed according
to contained ``| '' characters which have the meaning of
- ``or''. Or
- in other words: they indicate a set of alternatives from which the actual
+ ``or''.
+ In other words they indicate a set of alternatives from which the actual
returned value is chosen randomly. Although this sounds crazy and useless,
it
was actually designed for load balancing in a reverse proxy situation where
@@ -767,13 +766,13 @@ close(TXT) |
MapType: prg , MapSource: Unix filesystem path to valid
regular file
- Here the source is a Unix program, not a map file. To create it you can use
- the language of your choice, but the result has to be a run-able Unix
+ Here the source is a program, not a map file. To create it you
+ can use the language of your choice, but the result has to be a
executable (i.e., either object-code or a script with the
- magic cookie trick '#!/path/to/interpreter ' as the first
- line).
+ magic cookie trick '#!/path/to/interpreter ' as the
+ first line).
- This program gets started once at startup of the Apache servers and then
+ This program is started once at startup of the Apache servers and then
communicates with the rewriting engine over its stdin and
stdout file-handles. For each map-function lookup it will
receive the key to lookup as a newline-terminated string on
@@ -789,8 +788,7 @@ close(TXT)
#!/usr/bin/perl
$| = 1;
while (<STDIN>) {
- # ...here any transformations
- # or lookups should occur...
+ # ...put here any transformations or lookups...
print $_;
}
@@ -798,15 +796,15 @@ while (<STDIN>) {
But be very careful:
- - ``Keep the program simple, stupid'' (KISS), because
- if this program hangs it will lead to a hang of the Apache server
+
- ``Keep it simple, stupid'' (KISS), because
+ if this program hangs it will hang the Apache server
when the rule occurs.
- Avoid one common mistake: never do buffered I/O on
stdout !
This will cause a deadloop! Hence the ``$|=1 '' in the
above example...
- Use the RewriteLock directive to define a lockfile
mod_rewrite can use to synchronize the communication to the program.
- Per default no such synchronization takes place.
+ By default no such synchronization takes place.
@@ -819,7 +817,7 @@ this map in per-directory context.
-Notice: For plain text and DBM format files the looked-up
+Note: For plain text and DBM format files the looked-up
keys are cached in-core
until the mtime of the mapfile changes or the server does a
restart. This way you can have map-functions in rules which are used
@@ -869,15 +867,15 @@ per-directory rewrites. As you will see below, RewriteRule can be
used in per-directory config files (.htaccess ). There it will act
locally, i.e., the local directory prefix is stripped at this stage of
processing and your rewriting rules act only on the remainder. At the end
-it is automatically added.
+it is automatically added back to the path.
When a substitution occurs for a new URL, this module has to re-inject the URL
into the server processing. To be able to do this it needs to know what the
corresponding URL-prefix or URL-base is. By default this prefix is the
corresponding filepath itself. But at most websites URLs are
-NOT directly related to physical filename paths, so this
-assumption will be usually be wrong! There you have to use the
+NOT directly related to physical filename paths, so this
+assumption will usually be wrong! There you have to use the
RewriteBase directive to specify the correct URL-prefix.
@@ -908,7 +906,7 @@ directives.
RewriteEngine On
-# let the server know that we are reached via /xyz and not
+# let the server know that we were reached via /xyz and not
# via the physical path prefix /abc/def
RewriteBase /xyz
@@ -926,7 +924,7 @@ rewritten to the physical file /abc/def/newstuff.html .
-Notice - For the Apache hackers:
+Note - For Apache hackers:
The following list gives detailed information about the internal
processing steps:
@@ -949,7 +947,7 @@ This seems very complicated but is the correct Apache internal processing,
because the per-directory rewriting comes too late in the process. So,
when it occurs the (rewritten) request has to be re-injected into the Apache
kernel! BUT: While this seems like a serious overhead, it really isn't, because
-this re-injection happens fully internal to the Apache server and the same
+this re-injection happens fully internally to the Apache server and the same
procedure is used by many other operations inside Apache. So, you can be
sure the design and implementation is correct.
@@ -1028,7 +1026,7 @@ the form
%N
-(1 <= N <= 9) which provide access to the grouped parts (parenthesis!) of
+(1 <= N <= 9) which provide access to the grouped parts (parentheses!) of
the pattern from the last matched RewriteCond directive in the
current bunch of conditions.
@@ -1041,7 +1039,7 @@ current bunch of conditions.
where NAME_OF_VARIABLE can be a string
-of the following list:
+taken from the following list:
@@ -1120,7 +1118,7 @@ IS_SUBREQ
-Notice: These variables all correspond to the similar named
+Notice: These variables all correspond to the similarly named
HTTP MIME-headers, C variables of the Apache server or struct tm
fields of the Unix system.
|
@@ -1157,7 +1155,7 @@ is the value of the HTTP header ``Proxy-Connection: ''.
There is the special format %{LA-U:variable} for look-aheads
which perform an internal (URL-based) sub-request to determine the final value
of variable. Use this when you want to use a variable for rewriting
-which actually is set later in an API phase and thus is not available at the
+which is actually set later in an API phase and thus is not available at the
current stage. For instance when you want to rewrite according to the
REMOTE_USER variable from within the per-server context
(httpd.conf file) you have to use %{LA-U:REMOTE_USER}
@@ -1169,16 +1167,16 @@ authorization phases come before this phase, you just can use
%{REMOTE_USER} there.
- There is the special format: %{LA-F:variable} which perform an
+There is the special format: %{LA-F:variable} which performs an
internal (filename-based) sub-request to determine the final value of
-variable. This is the most of the time the same as LA-U above.
+variable. Most of the time this is the same as LA-U above.
CondPattern is the condition pattern, i.e., a regular
expression
-which gets applied to the current instance of the TestString,
-i.e., TestString gets evaluated and then matched against
+which is applied to the current instance of the TestString,
+i.e., TestString is evaluated and then matched against
CondPattern.
@@ -1186,7 +1184,7 @@ which gets applied to the current instance of the TestString,
Extended Regular Expression with some additions:
-- You can precede the pattern string with a '
! ' character
+ - You can prefix the pattern string with a '
! ' character
(exclamation mark) to specify a non-matching pattern.
@@ -1195,23 +1193,23 @@ There are some special variants of CondPatterns. Instead of real
regular expression strings you can also use one of the following:
-- '<CondPattern' (is lexicographically lower)
+ - '<CondPattern' (is lexically lower)
Treats the CondPattern as a plain string and compares it
-lexicographically to TestString and results in a true expression if
-TestString is lexicographically lower than CondPattern.
+lexically to TestString. True if
+TestString is lexically lower than CondPattern.
- - '>CondPattern' (is lexicographically greater)
+ - '>CondPattern' (is lexically greater)
Treats the CondPattern as a plain string and compares it
-lexicographically to TestString and results in a true expression if
-TestString is lexicographically greater than CondPattern.
+lexically to TestString. True if
+TestString is lexically greater than CondPattern.
- - '=CondPattern' (is lexicographically equal)
+ - '=CondPattern' (is lexically equal)
Treats the CondPattern as a plain string and compares it
-lexicographically to TestString and results in a true expression if
-TestString is lexicographically equal to CondPattern, i.e the
+lexically to TestString. True if
+TestString is lexically equal to CondPattern, i.e the
two strings are exactly equal (character by character).
If CondPattern is just "" (two quotation marks) this
-compares TestString against the empty string.
+compares TestString to the empty string.
- '-d' (is directory)
Treats the TestString as a pathname and
@@ -1246,7 +1244,7 @@ your server's performance!
Notice:
-All of these tests can also be prefixed by a not ('!') character
+All of these tests can also be prefixed by an exclamation mark ('!')
to negate their meaning.
|
@@ -1264,7 +1262,7 @@ is a comma-separated list of the following flags:
- '
nocase|NC ' (no case)
- This makes the condition test case-insensitive, i.e., there is
+ This makes the test case-insensitive, i.e., there is
no difference between 'A-Z' and 'a-z' both in the expanded
TestString and the CondPattern.
@@ -1278,7 +1276,7 @@ RewriteCond %{REMOTE_HOST} ^host2.* [OR]
RewriteCond %{REMOTE_HOST} ^host3.*
RewriteRule ...some special stuff for any of these hosts...
- Without this flag you had to write down the cond/rule three times.
+ Without this flag you would have to write the cond/rule three times.
@@ -1347,12 +1345,13 @@ rewriting rule. The definition order of these rules is
run-time.
-Pattern can be (for Apache 1.1.x a System
-V8 and for Apache 1.2.x a POSIX) regular expression
-which gets applied to the current URL. Here ``current'' means the value of the
-URL when this rule gets applied. This may not be the original requested
-URL, because there could be any number of rules before which already matched
-and made alterations to it.
+Pattern can be (for Apache
+1.1.x a System V8 and for Apache 1.2.x and later a POSIX) regular expression which gets applied to the current
+URL. Here ``current'' means the value of the URL when this rule gets
+applied. This may not be the originally requested URL, because no
+longer existingany number of rules may already have matched and made
+alterations to it.
Some hints about the syntax of regular expressions:
@@ -1370,7 +1369,7 @@ Some hints about the syntax of regular expressions:
Quantifiers:
? 0 or 1 of the preceding text
- * 0 or N of the preceding text (N > 1)
+ * 0 or N of the preceding text (N > 0)
+ 1 or N of the preceding text (N > 1)
Grouping:
@@ -1394,8 +1393,8 @@ Some hints about the syntax of regular expressions:
For more information about regular expressions either have a look at your
local regex(3) manpage or its src/regex/regex.3 copy in the
-Apache 1.3 distribution. When you are interested in more detailed and deeper
-information about regular expressions and its variants (POSIX regex, Perl
+Apache 1.3 distribution. If you are interested in more detailed
+information about regular expressions and their variants (POSIX regex, Perl
regex, etc.) have a look at the following dedicated book on this topic:
@@ -1409,9 +1408,9 @@ ISBN 1-56592-257-3
Additionally in mod_rewrite the NOT character ('! ') is a possible
pattern prefix. This gives you the ability to negate a pattern; to say, for
-instance: ``if the current URL does NOT match to this
-pattern''. This can be used for special cases where it is better to match
-the negative pattern or as a last default rule.
+instance: ``if the current URL does NOT match this
+pattern''. This can be used for exceptional cases, where it is easier to
+match the negative pattern, or as a last default rule.
@@ -1448,8 +1447,8 @@ the above list.
As already mentioned above, all the rewriting rules are applied to the
Substitution (in the order of definition in the config file). The
URL is completely replaced by the Substitution and the
-rewriting process goes on until there are no more rules (unless explicitly
-terminated by a L flag - see below).
+rewriting process goes on until there are no more rules unless explicitly
+terminated by a L flag - see below.
There is a special substitution string named '- ' which means:
@@ -1468,7 +1467,7 @@ substitution string with just the question mark.
-Notice: There is a special feature. When you prefix a substitution
+Note: There is a special feature: When you prefix a substitution
field with http:// thishost[:thisport] then
mod_rewrite automatically strips it out. This auto-reduction on
implicit external redirect URLs is a useful and important feature when
@@ -1508,14 +1507,14 @@ comma-separated list of the following flags:
one of the following symbolic names: temp (default), permanent ,
seeother .
Use it for rules which should
- canonicalize the URL and gives it back to the client, e.g., translate
+ canonicalize the URL and give it back to the client, e.g., translate
``/~ '' into ``/u/ '' or always append a slash to
/u/ user, etc.
- Notice: When you use this flag, make sure that the
+ Note: When you use this flag, make sure that the
substitution field is a valid URL! If not, you are redirecting to an
invalid location! And remember that this flag itself only prefixes the
- URL with http://thishost[:thisport]/ , but rewriting goes on.
+ URL with http://thishost[:thisport]/ , rewriting continues.
Usually you also want to stop and do the redirection immediately. To stop
the rewriting you also have to provide the 'L' flag.
@@ -1526,8 +1525,8 @@ comma-separated list of the following flags:
- '
gone|G ' (force URL to be gone)
This forces the current URL to be gone, i.e., it immediately sends back a
- HTTP response of 410 (GONE). Use this flag to mark no longer existing
- pages as gone.
+ HTTP response of 410 (GONE). Use this flag to mark pages which no longer
+ exist as gone.
- '
proxy|P ' (force proxy)
This flag forces the substitution part to be internally forced as a proxy
@@ -1552,7 +1551,7 @@ comma-separated list of the following flags:
don't apply any more rewriting rules. This corresponds to the Perl
last command or the break command from the C
language. Use this flag to prevent the currently rewritten URL from being
- rewritten further by following rules which may be wrong. For
+ rewritten further by following rules. For
example, use it to rewrite the root-path URL ('/ ') to a real
one, e.g., '/e/www/ '.
@@ -1563,11 +1562,11 @@ comma-separated list of the following flags:
next command or the continue command from the C
language. Use this flag to restart the rewriting process, i.e., to
immediately go to the top of the loop.
- But be careful not to create a deadloop!
+ But be careful not to create an infinite loop!
- '
chain|C ' (chained with next rule)
This flag chains the current rule with the next rule (which itself can
- also be chained with its following rule, etc.). This has the following
+ be chained with the following rule, etc.). This has the following
effect: if a rule matches, then processing continues as usual, i.e., the
flag has no effect. If the rule does not match, then all following
chained rules are skipped. For instance, use it to remove the
@@ -1628,7 +1627,7 @@ comma-separated list of the following flags:
translator should do. Then mod_alias comes and tries to do a
URI-to-filename transition which will not work.
- Notice: You have to use this flag if you want to intermix directives
+ Note: You have to use this flag if you want to intermix directives
of different modules which contain URL-to-filename translators. The
typical example is the use of mod_alias and
mod_rewrite ..
@@ -1636,12 +1635,12 @@ comma-separated list of the following flags:
- Notice - For the Apache hackers:
+ Note - For Apache hackers:
If the current Apache API had a
filename-to-filename hook additionally to the URI-to-filename hook then
we wouldn't need this flag! But without such a hook this flag is the
only solution. The Apache Group has discussed this problem and will
- add such hooks into Apache version 2.0.
+ add such a hook in Apache version 2.0.
|
@@ -1650,7 +1649,7 @@ comma-separated list of the following flags:
This flag forces the rewriting engine to skip the next num rules
in sequence when the current rule matches. Use this to make pseudo
if-then-else constructs: The last rule of the then-clause becomes
- a skip=N where N is the number of rules in the else-clause.
+ skip=N where N is the number of rules in the else-clause.
(This is not the same as the 'chain|C' flag!)
- '
env|E= VAR:VAL' (set environment variable)
@@ -1658,9 +1657,9 @@ comma-separated list of the following flags:
value VAL, where VAL can contain regexp backreferences
$N and %N which will be expanded. You can use this flag
more than once to set more than one variable. The variables can be later
- dereferenced at a lot of situations, but the usual location will be from
+ dereferenced in many situations, but usually from
within XSSI (via <!--#echo var="VAR"--> ) or CGI (e.g.
- $ENV{'VAR'} ). But additionally you can also dereference it in a
+ $ENV{'VAR'} ). Additionally you can dereference it in a
following RewriteCond pattern via %{ENV:VAR} . Use this to strip
but remember information from URLs.
@@ -1668,16 +1667,16 @@ comma-separated list of the following flags:
-Notice: Never forget that Pattern gets applied to a complete URL
+Note: Never forget that Pattern is applied to a complete URL
in per-server configuration files. But in per-directory configuration
files, the per-directory prefix (which always is the same for a specific
-directory!) gets automatically removed for the pattern matching and
+directory!) is automatically removed for the pattern matching and
automatically added after the substitution has been done. This feature is
essential for many sorts of rewriting, because without this prefix stripping
you have to match the parent directory which is not always possible.
There is one exception: If a substitution string starts with
-``http:// '' then the directory prefix will be not added and a
+``http:// '' then the directory prefix will not be added and an
external redirect or proxy throughput (if flag P is used!) is forced!
|
@@ -1685,9 +1684,9 @@ external redirect or proxy throughput (if flag P is used!) is f
-Notice: To enable the rewriting engine for per-directory configuration files
+Note: To enable the rewriting engine for per-directory configuration files
you need to set ``RewriteEngine On '' in these files and
-``Option FollowSymLinks '' enabled. If your administrator has
+``Option FollowSymLinks '' must be enabled. If your administrator has
disabled override of FollowSymLinks for a user's directory, then
you cannot use the rewriting engine. This restriction is needed for
security reasons.
@@ -1841,7 +1840,7 @@ variables SCRIPT_NAME and SCRIPT_FILENAME contain the
Notice: These variables hold the URI/URL as they were initially
-requested, i.e., in a state before any rewriting. This is
+requested, i.e., before any rewriting. This is
important because the rewriting process is primarily used to rewrite logical
URLs to physical pathnames.
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/index.html b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/index.html
index 265f4a78c5c..30ea742cde1 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/index.html
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/index.html
@@ -148,7 +148,7 @@ H4 {
|
- mod_ssl version 2.5
+ mod_ssl version 2.6
|
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_compat.html b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_compat.html
index e43f61dea01..19875dfb13f 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_compat.html
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_compat.html
@@ -556,7 +556,7 @@ if (document.images) {
- mod_ssl 2.5, User Manual
+ mod_ssl 2.6, User Manual
The Apache Interface to OpenSSL
|
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_cover.wml b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_cover.wml
index 1028e99910d..988a0091367 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_cover.wml
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_cover.wml
@@ -1,4 +1,4 @@
-#!wml -oindex.html
+#!wml -o index.html
#use "ssl_template.inc" title="Title Page" tag=title num=0
@@ -17,7 +17,7 @@
- mod_ssl version 2.5
+ mod_ssl version 2.6
|
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_faq.html b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_faq.html
index b633181bddb..926a739c575 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_faq.html
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_faq.html
@@ -292,46 +292,47 @@ author.
Permission problem on SSLMutex
Shared memory and process size?
Shared memory and pathname?
- About Configuration
- HTTP and HTTPS with a single server?
- Where is the HTTPS port?
- How to test HTTPS manually?
- Why does my connection hang?
- Why do I get connection refused?
- Why are the SSL_XXX variables missing?
- How to switch with relative hyperlinks?
- About Certificates
- What are Keys, CSRs and Certs?
- Difference on startup?
- How to create a dummy cert?
- How to create a real cert?
- How to create my own CA?
- How to change a pass phrase?
- How to remove a pass phrase?
- How to verify a key/cert pair?
- Bad Certificate Error?
- Why does a 2048-bit key not work?
- Why is client auth broken?
- How to convert from PEM to DER?
- Verisign and the magic getca program?
- Global IDs or SGC?
- Global IDs and Cert Chain?
- About SSL Protocol
- Why has the server a higher load?
- Why are connections horribly slow?
- Which ciphers are supported?
- How to use Anonymous-DH ciphers
- Why do I get 'no shared ciphers'?
- HTTPS and name-based vhosts
- The lock icon in Netscape locks very late
- Why do I get I/O errors with my MSIE clients?
- Why do I get I/O errors with my NS clients?
- About Support
- Resources in case of problems?
- Support in case of problems?
- How to write a problem report?
- I got a core dump, can you help me?
- How to get a backtrace?
+ PRNG and not enough entropy?
+ About Configuration
+ HTTP and HTTPS with a single server?
+ Where is the HTTPS port?
+ How to test HTTPS manually?
+ Why does my connection hang?
+ Why do I get connection refused?
+ Why are the SSL_XXX variables missing?
+ How to switch with relative hyperlinks?
+ About Certificates
+ What are Keys, CSRs and Certs?
+ Difference on startup?
+ How to create a dummy cert?
+ How to create a real cert?
+ How to create my own CA?
+ How to change a pass phrase?
+ How to remove a pass phrase?
+ How to verify a key/cert pair?
+ Bad Certificate Error?
+ Why does a 2048-bit key not work?
+ Why is client auth broken?
+ How to convert from PEM to DER?
+ Verisign and the magic getca program?
+ Global IDs or SGC?
+ Global IDs and Cert Chain?
+ About SSL Protocol
+ Why has the server a higher load?
+ Why are connections horribly slow?
+ Which ciphers are supported?
+ How to use Anonymous-DH ciphers
+ Why do I get 'no shared ciphers'?
+ HTTPS and name-based vhosts
+ The lock icon in Netscape locks very late
+ Why do I get I/O errors with my MSIE clients?
+ Why do I get I/O errors with my NS clients?
+ About Support
+ Resources in case of problems?
+ Support in case of problems?
+ How to write a problem report?
+ I got a core dump, can you help me?
+ How to get a backtrace?
|
|
@@ -346,7 +347,7 @@ author.
-
What is the history of mod_ssl?
- [L]
+ [L]
The mod_ssl v1 package was initially created in April 1998 by Ralf S. Engelschall via porting
What are the functional differences between mod_ssl and Apache-SSL, from where
it is originally derived?
- [L]
+ [L]
This neither can be answered in short (there were too much code changes)
nor can be answered at all by the author (there would be immediately flame
@@ -410,7 +411,7 @@ it is originally derived?
What are the major differences between mod_ssl and
the commercial alternatives like Raven or Stronghold?
- [L]
+ [L]
As of this writing (end of the year 1999) the major difference is
the RSA license which one receives (very cheaply in contrast to
@@ -458,7 +459,7 @@ the commercial alternatives like Raven or Stronghold?
-
How do I know which mod_ssl version is for which Apache version?
- [L]
+ [L]
That's trivial: mod_ssl uses version strings of the syntax
<mod_ssl-version>-<apache-version>, for
@@ -471,7 +472,7 @@ the commercial alternatives like Raven or Stronghold?
-
Is mod_ssl Year 2000 compliant?
- [L]
+ [L]
Yes, mod_ssl is Year 2000 compliant.
@@ -494,7 +495,7 @@ the commercial alternatives like Raven or Stronghold?
-
What about mod_ssl and the Wassenaar Arrangement?
- [L]
+ [L]
First, let us explain what Wassenaar and it's Arrangement on
Export Controls for Conventional Arms and Dual-Use Goods and
@@ -551,7 +552,7 @@ the commercial alternatives like Raven or Stronghold?
-
When I access my website the first time via HTTPS I get a core dump?
- [L]
+ [L]
There can be a lot of reasons why a core dump can occur, of course.
Ranging from buggy third-party modules, over buggy vendor libraries up to
@@ -565,7 +566,7 @@ the commercial alternatives like Raven or Stronghold?
-
My Apache dumps core when I add both mod_ssl and PHP3?
- [L]
+ [L]
Make sure you add mod_ssl to the Apache source tree first and then do a
fresh configuration and installation of PHP3. For SSL support EAPI patches
@@ -576,7 +577,7 @@ the commercial alternatives like Raven or Stronghold?
-
When I startup Apache I get errors about undefined symbols like ap_global_ctx?
- [L]
+ [L]
This actually means you installed mod_ssl as a DSO, but without rebuilding
Apache with EAPI. Because EAPI is a requirement for mod_ssl, you need an
@@ -587,7 +588,7 @@ the commercial alternatives like Raven or Stronghold?
-
When I startup Apache I get permission errors related to SSLMutex?
- [L]
+ [L]
When you receive entries like ``mod_ssl: Child could not open
SSLMutex lockfile /opt/apache/logs/ssl_mutex.18332 (System error follows)
@@ -602,7 +603,7 @@ the commercial alternatives like Raven or Stronghold?
When I use the MM library and the shared memory cache each process grows
1.5MB according to `top' although I specified 512000 as the cache size?
- [L]
+ [L]
The additional 1MB are caused by the global shared memory pool EAPI
allocates for all modules and which is not used by mod_ssl for
@@ -619,23 +620,47 @@ the commercial alternatives like Raven or Stronghold?
Apache creates files in a directory declared by the internal
EAPI_MM_CORE_PATH define. Is there a way to override the path using a
configuration directive?
- [L]
+ [L]
No, there is not configuration directive, because for technical
bootstrapping reasons, a directive not possible at all. Instead
use ``CFLAGS='-DEAPI_MM_CORE_PATH="/path/to/wherever/"'
./configure ... '' when building Apache or use option
-d when starting httpd .
+
+ -
+
+ When I fire up the server, mod_ssl stops with the error
+"Failed to generate temporary 512 bit RSA private key", why?
+And a "PRNG not seeded" error occurs if I try "make certificate".
+ [L]
+
+ Cryptographic software needs a source of unpredictable data
+ to work correctly. Many open source operating systems provide
+ a "randomness device" that serves this purpose (usually named
+ /dev/random ). On other systems, applications have to
+ seed the OpenSSL Pseudo Random Number Generator (PRNG) manually with
+ appropriate data before generating keys or performing public key
+ encryption. As of version 0.9.5, the OpenSSL functions that need
+ randomness report an error if the PRNG has not been seeded with
+ at least 128 bits of randomness. So mod_ssl has to provide enough
+ entropy to the PRNG to work correctly. For this one has to use the
+ SSLRandSeed directives (to solve the run-time problem)
+ and create a $HOME/.rnd file to make sure enough
+ entropy is available also for the "make certificate "
+ step (in case the "make certificate " procedure is not
+ able to gather enough entropy theirself by searching for system
+ files).
-
+
- -
+
-
Is it possible to provide HTTP and HTTPS with a single server?
- [L]
+ [L]
Yes, HTTP and HTTPS use different server ports, so there is no direct
conflict between them. Either run two separate server instances (one binds
@@ -644,20 +669,20 @@ configuration directive?
Apache dispatches: one responding to port 80 and speaking HTTP and one
responding to port 443 speaking HTTPS.
- -
+
-
I know that HTTP is on port 80, but where is HTTPS?
- [L]
+ [L]
You can run HTTPS on any port, but the standards specify port 443, which
is where any HTTPS compliant browser will look by default. You can force
your browser to look on a different port by specifying it in the URL like
this (for port 666): https://secure.server.dom:666/
- -
+
-
How can I speak HTTPS manually for testing purposes?
- [L]
+ [L]
While you usually just use
@@ -683,10 +708,10 @@ configuration directive?
$ curl http://localhost/
$ curl https://localhost/
- -
+
-
Why does the connection hang when I connect to my SSL-aware Apache server?
- [L]
+ [L]
Because you connected with HTTP to the HTTPS port, i.e. you used an URL of
the form ``http:// '' instead of ``https:// ''.
@@ -696,11 +721,11 @@ configuration directive?
virtual server that supports SSL, which is probably the IP associated with
your hostname, not localhost (127.0.0.1).
- -
+
-
Why do I get ``Connection Refused'' messages when trying to access my freshly
installed Apache+mod_ssl server via HTTPS?
- [L]
+ [L]
There can be various reasons. Some of the common mistakes is that people
start Apache with just ``apachectl start'' (or
@@ -711,19 +736,19 @@ installed Apache+mod_ssl server via HTTPS?
yourself a favor and start over with the default configuration mod_ssl
provides you.
- -
+
-
In my CGI programs and SSI scripts the various documented
SSL_XXX variables do not exists. Why?
- [L]
+ [L]
Just make sure you have ``SSLOptions +StdEnvVars ''
enabled for the context of your CGI/SSI requests.
- -
+
-
How can I use relative hyperlinks to switch between HTTP and HTTPS?
- [L]
+ [L]
Usually you have to use fully-qualified hyperlinks because
you have to change the URL scheme. But with the help of some URL
@@ -741,13 +766,13 @@ installed Apache+mod_ssl server via HTTPS?
-
+
- -
+
-
What are RSA Private Keys, CSRs and Certificates?
- [L]
+ [L]
The RSA private key file is a digital file that you can use to decrypt
messages sent to you. It has a public component which you distribute (via
@@ -762,10 +787,10 @@ installed Apache+mod_ssl server via HTTPS?
See the Introduction chapter for a general
description of the SSL protocol.
- -
+
-
Seems like there is a difference on startup between the original Apache and an SSL-aware Apache?
- [L]
+ [L]
Yes, in general, starting Apache with a built-in mod_ssl is just like
starting an unencumbered Apache, except for the fact that when you have a
@@ -778,10 +803,10 @@ installed Apache+mod_ssl server via HTTPS?
below under ``How can I get rid of the pass-phrase dialog at Apache
startup time?''.
- -
+
-
How can I create a dummy SSL server Certificate for testing purposes?
- [L]
+ [L]
A Certificate does not have to be signed by a public CA. You can use your
private key to sign the Certificate which contains your public key. You
@@ -800,11 +825,11 @@ installed Apache+mod_ssl server via HTTPS?
BUT REMEMBER: YOU REALLY HAVE TO CREATE A REAL CERTIFICATE FOR THE LONG
RUN! HOW THIS IS DONE IS DESCRIBED IN THE NEXT ANSWER.
- -
+
-
Ok, I've got my server installed and want to create a real SSL
server Certificate for it. How do I do it?
- [L]
+ [L]
Here is a step-by-step description:
@@ -896,10 +921,10 @@ server Certificate for it. How do I do it?
The server.csr file is no longer needed.
- -
+
-
How can I create and use my own Certificate Authority (CA)?
- [L]
+ [L]
The short answer is to use the CA.sh or CA.pl
script provided by OpenSSL. The long and manual answer is this:
@@ -946,10 +971,10 @@ server Certificate for it. How do I do it?
This signs the server CSR and results in a server.crt file.
- -
+
-
How can I change the pass-phrase on my private key file?
- [L]
+ [L]
You simply have to read it with the old pass-phrase and write it again
by specifying the new pass-phrase. You can accomplish this with the following
@@ -962,10 +987,10 @@ server Certificate for it. How do I do it?
prompt enter the old pass-phrase and at the second prompt
enter the new pass-phrase.
- -
+
-
How can I get rid of the pass-phrase dialog at Apache startup time?
- [L]
+ [L]
The reason why this dialog pops up at startup and every re-start
is that the RSA private key inside your server.key file is stored in
@@ -997,10 +1022,10 @@ server Certificate for it. How do I do it?
exec:/path/to/program '' facility. But keep in mind that this is
neither more nor less secure, of course.
- -
+
-
How do I verify that a private key matches its Certificate?
- [L]
+ [L]
The private key contains a series of numbers. Two of those numbers form
the "public key", the others are part of your "private key". The "public
@@ -1027,11 +1052,11 @@ server Certificate for it. How do I do it?
$ openssl req -noout -modulus -in server.csr | openssl md5
- -
+
-
What does it mean when my connections fail with an "alert bad certificate"
error?
- [L]
+ [L]
Usually when you see errors like ``OpenSSL: error:14094412: SSL
routines:SSL3_READ_BYTES:sslv3 alert bad certificate'' in the SSL
@@ -1039,10 +1064,10 @@ error?
certificate/private-key which perhaps contain a RSA-key not equal to 1024
bits. For instance Netscape Navigator 3.x is one of those browsers.
- -
+
-
Why does my 2048-bit private key not work?
- [L]
+ [L]
The private key sizes for SSL must be either 512 or 1024 for compatibility
with certain web browsers. A keysize of 1024 bits is recommended because
@@ -1050,11 +1075,11 @@ error?
Navigator and Microsoft Internet Explorer, and with other browsers that
use RSA's BSAFE cryptography toolkit.
- -
+
-
Why is client authentication broken after upgrading from
SSLeay version 0.8 to 0.9?
- [L]
+ [L]
The CA certificates under the path you configured with
SSLCACertificatePath are found by SSLeay through hash
@@ -1064,10 +1089,10 @@ SSLeay version 0.8 to 0.9?
all old hash symlinks and re-create new ones after upgrading. Use the
Makefile mod_ssl placed into this directory.
- -
+
-
How can I convert a certificate from PEM to DER format?
- [L]
+ [L]
The default certificate format for SSLeay/OpenSSL is PEM, which actually
is Base64 encoded DER with header and footer lines. For some applications
@@ -1076,11 +1101,11 @@ SSLeay version 0.8 to 0.9?
corresponding DER file cert.der with the following command:
$ openssl x509 -in cert.pem -out cert.der -outform DER
- -
+
-
I try to install a Verisign certificate. Why can't I find neither the
getca nor getverisign programs Verisign mentions?
- [L]
+ [L]
This is because Verisign has never provided specific instructions
for Apache+mod_ssl. Rather they tell you what you should do
@@ -1094,11 +1119,11 @@ SSLeay version 0.8 to 0.9?
href="http://www.thawte.com/certs/server/keygen/mod_ssl.html">
Thawte's mod_ssl instructions.
- -
+
-
Can I use the Server Gated Cryptography (SGC) facility (aka Verisign Global
ID) also with mod_ssl?
- [L]
+ [L]
Yes, mod_ssl since version 2.1 supports the SGC facility. You don't have
to configure anything special for this, just use a Global ID as your
@@ -1106,11 +1131,11 @@ ID) also with mod_ssl?
automatically handled by mod_ssl under run-time. For details please read
the README.GlobalID document in the mod_ssl distribution.
- -
+
-
After I have installed my new Verisign Global ID server certificate, the
browsers complain that they cannot verify the server certificate?
- [L]
+ [L]
That is because Verisign uses an intermediate CA certificate between
the root CA certificate (which is installed in the browsers) and
@@ -1123,34 +1148,34 @@ browsers complain that they cannot verify the server certificate?
-
+
- -
+
-
Why has my webserver a higher load now that I run SSL there?
- [L]
+ [L]
Because SSL uses strong cryptographic encryption and this needs a lot of
number crunching. And because when you request a webpage via HTTPS even
the images are transfered encrypted. So, when you have a lot of HTTPS
traffic the load increases.
- -
+
-
Often HTTPS connections to my server require up to 30 seconds for establishing
the connection, although sometimes it works faster?
- [L]
+ [L]
Usually this is caused by using a /dev/random device for
SSLRandomSeed which is blocking in read(2) calls if not
enough entropy is available. Read more about this problem in the refernce
chapter under SSLRandomSeed .
- -
+
-
What SSL Ciphers are supported by mod_ssl?
- [L]
+ [L]
Usually just all SSL ciphers which are supported by the
version of OpenSSL in use (can depend on the way you built
@@ -1171,11 +1196,11 @@ the connection, although sometimes it works faster?
$ openssl ciphers -v
- -
+
-
I want to use Anonymous Diffie-Hellman (ADH) ciphers, but I always get ``no
shared cipher'' errors?
- [L]
+ [L]
In order to use Anonymous Diffie-Hellman (ADH) ciphers, it is not enough
to just put ``ADH '' into your SSLCipherSuite .
@@ -1184,11 +1209,11 @@ shared cipher'' errors?
allow ADH ciphers for security reasons. So if you are actually enabling
these ciphers make sure you are informed about the side-effects.
- -
+
-
I always just get a 'no shared ciphers' error if
I try to connect to my freshly installed server?
- [L]
+ [L]
Either you have messed up your SSLCipherSuite
directive (compare it with the pre-configured example in
@@ -1202,10 +1227,10 @@ I try to connect to my freshly installed server?
this, regenerate your server certificate/key pair and this time
choose the RSA algorithm.
- -
+
-
Why can't I use SSL with name-based/non-IP-based virtual hosts?
- [L]
+ [L]
The reason is very technical. Actually it's some sort of a chicken and
egg problem: The SSL protocol layer stays below the HTTP protocol layer
@@ -1219,12 +1244,12 @@ I try to connect to my freshly installed server?
handshake is finished. But the information is already needed at the SSL
handshake phase. Bingo!
- -
+
-
When I use Basic Authentication over HTTPS the lock icon in Netscape browsers
still show the unlocked state when the dialog pops up. Does this mean the
username/password is still transmitted unencrypted?
- [L]
+ [L]
No, the username/password is already transmitted encrypted. The icon in
Netscape browsers is just not really synchronized with the SSL/TLS layer
@@ -1236,12 +1261,12 @@ username/password is still transmitted unencrypted?
handshake phase and switched to encrypted communication. So, don't get
confused by this icon.
- -
+
-
When I connect via HTTPS to an Apache+mod_ssl server with Microsoft Internet
Explorer (MSIE) I sometimes get I/O errors and the message "bad data from the
server". What's the reason?
- [L]
+ [L]
The reason is that MSIE's SSL implementation has some subtle bugs related
to the HTTP keep-alive facility and the SSL close notify alerts on socket
@@ -1253,12 +1278,12 @@ server". What's the reason?
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
- -
+
-
When I connect via HTTPS to an Apache+mod_ssl server with Netscape Navigator I
get I/O errors and the message "Netscape has encountered bad data from the
server" What's the reason?
- [L]
+ [L]
The problem usually is that you had created a new server certificate with
the same DN, but you had told your browser to accept forever the old
@@ -1269,21 +1294,21 @@ server" What's the reason?
-
+
- -
+
-
What information resources are available in case of mod_ssl problems?
- [L]
+ [L]
The following information resources are available.
In case of problems you should search here first.
- Answers in the User Manual's F.A.Q. List (this)
-
- http://www.modssl.org/docs/2.5/ssl_faq.html
+
+ http://www.modssl.org/docs/2.6/ssl_faq.html
First look inside the F.A.Q. (this text), perhaps your problem is such
popular that it was already answered a lot of times in the past.
@@ -1301,10 +1326,10 @@ In case of problems you should search here first.
someone else already has reported the problem.
- -
+
-
What support contacts are available in case of mod_ssl problems?
- [L]
+ [L]
The following lists all support possibilities for mod_ssl, in order of
preference, i.e. start in this order and do not pick the support possibility
@@ -1335,11 +1360,11 @@ you just like most, please.
usually not processed as fast as a posting on modssl-users.
- -
+
-
What information and details I've to provide to
the author when writing a bug report?
- [L]
+ [L]
You have to at least always provide the following information:
@@ -1373,10 +1398,10 @@ You have to at least always provide the following information:
course.
- -
+
-
I got a core dump, can you help me?
- [L]
+ [L]
In general no, at least not unless you provide more details about the code
location where Apache dumped core. What is usually always required in
@@ -1384,10 +1409,10 @@ You have to at least always provide the following information:
information it is mostly impossible to find the problem and help you in
fixing it.
- -
+
-
Ok, I got a core dump but how do I get a backtrace to find out the reason for it?
- [L]
+ [L]
Follow the following steps:
@@ -1477,7 +1502,7 @@ if (document.images) {
- mod_ssl 2.5, User Manual
+ mod_ssl 2.6, User Manual
The Apache Interface to OpenSSL
|
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_faq.wml b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_faq.wml
index 9a8250fe179..74e36599a86 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_faq.wml
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_faq.wml
@@ -69,7 +69,7 @@ author.
%body\
- [L]
+ [L]
@@ -365,6 +365,29 @@ configuration directive?
./configure ...'' when building Apache or use option
-d when starting httpd .
+
+When I fire up the server, mod_ssl stops with the error
+"Failed to generate temporary 512 bit RSA private key", why?
+And a "PRNG not seeded" error occurs if I try "make certificate".
+
+
+ Cryptographic software needs a source of unpredictable data
+ to work correctly. Many open source operating systems provide
+ a "randomness device" that serves this purpose (usually named
+ /dev/random ). On other systems, applications have to
+ seed the OpenSSL Pseudo Random Number Generator (PRNG) manually with
+ appropriate data before generating keys or performing public key
+ encryption. As of version 0.9.5, the OpenSSL functions that need
+ randomness report an error if the PRNG has not been seeded with
+ at least 128 bits of randomness. So mod_ssl has to provide enough
+ entropy to the PRNG to work correctly. For this one has to use the
+ SSLRandSeed directives (to solve the run-time problem)
+ and create a $HOME/.rnd file to make sure enough
+ entropy is available also for the "make certificate "
+ step (in case the "make certificate " procedure is not
+ able to gather enough entropy theirself by searching for system
+ files).
+
@@ -1051,8 +1074,8 @@ In case of problems you should search here first.
- Answers in the User Manual's F.A.Q. List (this)
-
- http://www.modssl.org/docs/2.5/ssl_faq.html
+
+ http://www.modssl.org/docs/2.6/ssl_faq.html
First look inside the F.A.Q. (this text), perhaps your problem is such
popular that it was already answered a lot of times in the past.
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_glossary.html b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_glossary.html
index 79947dd5f2a..3d2674cd4f8 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_glossary.html
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_glossary.html
@@ -218,7 +218,7 @@ realize that what you heard is not what I meant.''
-Unknown
+Richard Nixon
|
@@ -406,7 +406,7 @@ if (document.images) {
- mod_ssl 2.5, User Manual
+ mod_ssl 2.6, User Manual
The Apache Interface to OpenSSL
|
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_glossary.wml b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_glossary.wml
index 02841151ae4..d29b8d0b492 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_glossary.wml
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_glossary.wml
@@ -3,7 +3,7 @@
-
+
``I know you believe you understand what you think I said, but I am not sure you
realize that what you heard is not what I meant.''
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_howto.html b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_howto.html
index c8451adeb21..fe1c1326bb9 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_howto.html
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_howto.html
@@ -884,7 +884,7 @@ if (document.images) {
- mod_ssl 2.5, User Manual
+ mod_ssl 2.6, User Manual
The Apache Interface to OpenSSL
|
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_intro.html b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_intro.html
index ecee2367506..50e44466b06 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_intro.html
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_intro.html
@@ -239,7 +239,7 @@ year until the one arises you are looking for.''
-A. Tannenbaum, ``Introduction to Computer Networks''
+A. Tanenbaum, ``Introduction to Computer Networks''
|
@@ -916,7 +916,7 @@ if (document.images) {
- mod_ssl 2.5, User Manual
+ mod_ssl 2.6, User Manual
The Apache Interface to OpenSSL
|
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_intro.wml b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_intro.wml
index 03b438302b6..69af97df0f5 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_intro.wml
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_intro.wml
@@ -7,7 +7,7 @@
#use wml::std::toc style=nbsp
+ author="A. Tanenbaum, ``Introduction to Computer Networks''">
``The nice thing about standards is that there are so many to choose from.
And if you really don't like all the standards you just have to wait another
year until the one arises you are looking for.''
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_overview.html b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_overview.html
index 2d68c6ac544..90e021ad7b0 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_overview.html
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_overview.html
@@ -486,7 +486,7 @@ if (document.images) {
- mod_ssl 2.5, User Manual
+ mod_ssl 2.6, User Manual
The Apache Interface to OpenSSL
|
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_reference.html b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_reference.html
index de8166b5716..779dc7950d5 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_reference.html
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_reference.html
@@ -626,10 +626,11 @@ The following source variants are available:
On some platforms like FreeBSD one can even control how the entropy is
actually generated, i.e. by which system interrupts. More details one can
find under rndcontrol(8) on those platforms. Alternatively, when
- your system lacks such a random device, you can use tool like EGD (Entropy Gathering
- Daemon) and run it's client program with the
- exec:/path/to/program/ variant (see below).
+ your system lacks such a random device, you can use tool
+ like EGD
+ (Entropy Gathering Daemon) and run it's client program with the
+ exec:/path/to/program/ variant (see below) or use
+ egd:/path/to/egd-socket (see below).
exec:/path/to/program
@@ -644,6 +645,14 @@ The following source variants are available:
which is based on the AT&T truerand library). Using this in
the connection context slows down the server too dramatically, of course.
So usually you should avoid using external programs in that context.
+
+ egd:/path/to/egd-socket (Unix only)
+
+ This variant uses the Unix domain socket of the
+ external Entropy Gathering Daemon (EGD) (see http://www.lothar.com/tech
+ /crypto/) to seed the PRNG. Use this if no random device exists
+ on your platform.
Example:
@@ -2485,7 +2494,7 @@ if (document.images) {
- mod_ssl 2.5, User Manual
+ mod_ssl 2.6, User Manual
The Apache Interface to OpenSSL
|
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_reference.wml b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_reference.wml
index bd91edd0efd..0ebebfab536 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_reference.wml
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_reference.wml
@@ -295,10 +295,11 @@ The following source variants are available:
On some platforms like FreeBSD one can even control how the entropy is
actually generated, i.e. by which system interrupts. More details one can
find under rndcontrol(8) on those platforms. Alternatively, when
- your system lacks such a random device, you can use tool like EGD (Entropy Gathering
- Daemon) and run it's client program with the
- exec:/path/to/program/ variant (see below).
+ your system lacks such a random device, you can use tool
+ like EGD
+ (Entropy Gathering Daemon) and run it's client program with the
+ exec:/path/to/program/ variant (see below) or use
+ egd:/path/to/egd-socket (see below).
exec:/path/to/program
@@ -313,6 +314,14 @@ The following source variants are available:
which is based on the AT&T truerand library). Using this in
the connection context slows down the server too dramatically, of course.
So usually you should avoid using external programs in that context.
+
+ egd:/path/to/egd-socket (Unix only)
+
+ This variant uses the Unix domain socket of the
+ external Entropy Gathering Daemon (EGD) (see http://www.lothar.com/tech
+ /crypto/) to seed the PRNG. Use this if no random device exists
+ on your platform.
diff --git a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_template.inc b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_template.inc
index fd1161eae66..3529a504051 100644
--- a/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_template.inc
+++ b/usr.sbin/httpd/htdocs/manual/mod/mod_ssl/ssl_template.inc
@@ -233,7 +233,7 @@ H4 {
\
- mod_ssl 2.5, User Manual
+ mod_ssl 2.6, User Manual
The Apache Interface to OpenSSL
|
diff --git a/usr.sbin/httpd/htdocs/manual/vhosts/ip-based.html b/usr.sbin/httpd/htdocs/manual/vhosts/ip-based.html
index 7b8993b5c58..7aef0b67575 100644
--- a/usr.sbin/httpd/htdocs/manual/vhosts/ip-based.html
+++ b/usr.sbin/httpd/htdocs/manual/vhosts/ip-based.html
@@ -125,8 +125,9 @@ in the VirtualHost directive, with the exception of
Listen,
PidFile,
TypesConfig,
-ServerRoot and
-NameVirtualHost.
+ServerRoot,
+NameVirtualHost
+and a few other directives.
User and
Group may be used inside a VirtualHost
diff --git a/usr.sbin/httpd/src/ApacheCore.def b/usr.sbin/httpd/src/ApacheCore.def
index 26e748c42c6..c81df4845e6 100644
--- a/usr.sbin/httpd/src/ApacheCore.def
+++ b/usr.sbin/httpd/src/ApacheCore.def
@@ -360,17 +360,17 @@ EXPORTS
ap_SHA1Final @355
ap_sha1_base64 @356
ap_send_error_response @357
- ap_add_config_define @357
- ap_global_ctx @358
- ap_ctx_new @359
- ap_ctx_get @360
- ap_ctx_set @361
- ap_hook_init @362
- ap_hook_kill @363
- ap_hook_configure @364
- ap_hook_register_I @365
- ap_hook_unregister_I @366
- ap_hook_status @367
- ap_hook_use @368
- ap_hook_call @369
+ ap_add_config_define @358
+ ap_global_ctx @359
+ ap_ctx_new @360
+ ap_ctx_get @361
+ ap_ctx_set @362
+ ap_hook_init @363
+ ap_hook_kill @364
+ ap_hook_configure @365
+ ap_hook_register_I @366
+ ap_hook_unregister_I @367
+ ap_hook_status @368
+ ap_hook_use @369
+ ap_hook_call @370
diff --git a/usr.sbin/httpd/src/CHANGES b/usr.sbin/httpd/src/CHANGES
index 229ced6c17b..b4863aa7285 100644
--- a/usr.sbin/httpd/src/CHANGES
+++ b/usr.sbin/httpd/src/CHANGES
@@ -1,3 +1,66 @@
+Changes with Apache 1.3.12
+
+ *) Only OS/2 requires the addition "t" flag for ap_pfopen()
+ (as therefore fopen() as well). This is handled by the
+ FOPEN_REQUIRES_T macro. [Ian Turner ,
+ Jim Jagielski] PR#5760
+
+ *) The default charset is only added, when enabled, for those
+ Content-types which require it (text/plain, text/html).
+ [Jim Jagielski] PR#5766
+
+ *) Fix handling of multiple queries in APXS commands (e.g. "apxs -q
+ CC CFLAGS") and make sure Perl-related command line options (which
+ can contain the "::" constructs) do no longer cause an incorrect
+ internal parsing of the query result.
+ [Ralf S. Engelschall, Steve Robb ]
+
+ *) Avoid infinite looping in APACI's configure script
+ inside Ultrix' /bin/sh5 upgrade step.
+ [Jan Gallo , Ralf S. Engelschall] PR#4940
+
+ *) PORT: Add support for Amdahl UTS 4.3 and later.
+ [Dave Dykstra ] PR#5654
+
+ *) Make implementation/descriptions of the FLAG directives
+ AuthAuthoritative, MetaFiles and ExtendedStatus consistent with
+ documentation and the standard way of implementation those directives.
+ [David MacKenzie , Ralf S. Engelschall] PR#5642
+
+ *) Cast integer ap_wait_t values in http_main.c to get rid of compile
+ time errors on platforms where "ap_wait_t" is not defined as "int"
+ (currently only the NEXT and UTS21 platforms).
+ [Gary Bickford , Ralf S. Engelschall] PR#5053
+
+ *) The default suexec path was HTTPD_ROOT/sbin/suexec if not
+ configured via APACI. Changed to HTTPD_ROOT/bin/suexec.
+ [Lars Eilebrecht]
+
+ *) Add an explicit charset=iso-8859-1 to pages generated by
+ ap_send_error_response(), such as the default 404 page.
+ [Marc Slemko]
+
+ *) Add the AddDefaultCharset directive. This allows you to specify
+ the given character set on any document that does not have one
+ explicitly specified in the headers. [Marc Slemko, Jim Jagielski]
+
+ *) Properly escape various messages output to the client from a number
+ of modules and places in the core code. [Marc Slemko]
+
+ *) Change mod_actions, mod_autoindex, mod_expires, and mod_log_config to
+ not consider any parameters such as charset when making decisions
+ based on content type. This does remove some functionality for
+ some users, but means that when these modules are configured to do
+ particular things with particular MIME types, the charset should
+ not be included. A better way of addressing this for users who
+ want to set things on a per charset basis is necessary in the future.
+ [Marc Slemko]
+
+ *) mod_include now entity encodes output from "printenv" and "echo var"
+ by default. The encoding for "echo var" can be set to URL encoding
+ or no encoding using the new "encoding" attribute to the echo tag.
+ [Marc Slemko]
+
Changes with Apache 1.3.11
*) MPE builds are no longer stripped, which caused the executable
@@ -266,7 +329,7 @@ Changes with Apache 1.3.10
*) Added a CLF '-' respecting %B to the log format.
Suggested by Ragnar Kjørstad [dirkx]
- *) Added protocol(%m)/method(%H) logging to the log format.
+ *) Added protocol(%H)/method(%m) logging to the log format.
Suggested by Peter W [dirkx]
*) Added a HEAD method to 'ab'. [dirkx]
diff --git a/usr.sbin/httpd/src/CHANGES.SSL b/usr.sbin/httpd/src/CHANGES.SSL
index 649b5e0ce47..66b7d5df32e 100644
--- a/usr.sbin/httpd/src/CHANGES.SSL
+++ b/usr.sbin/httpd/src/CHANGES.SSL
@@ -17,12 +17,154 @@
_INTENTIONALLY_ no contributor names attached to the entries. Instead all
contributors are listed in the CREDITS file.
+ ____ __
+ |___ \ / /_
+ __) || '_ \
+ / __/ | (_) |
+ __ |_____(_)___/____________________________________________
+
+ Changes with mod_ssl 2.6.2 (29-Feb-2000 to 02-Mar-2000)
+
+ *) Updated the conf/ssl.crt/ca-bundle.crt file (containing the CA
+ Root Certificates of over 60 popular CAs) to the contents extracted
+ from Netscape Communicator 4.72's cert7.db file.
+
+ *) Fixed compilation of the new HTTPS proxy code (SSL_EXPERIMENTAL):
+ The SSL_VENDOR was required without need if SSL_EXPERIMENTAL was
+ enabled. This is now fixed and only SSL_EXPERIMENTAL is requied again
+ for the new HTTPS proxy stuff.
+
+ *) Added an FAQ entry about the "less entropy for the PRNG"
+ problem which now becomes "popular" ;) with OpenSSL 0.9.5.
+
+ *) Fixed conf/ssl.crl/Makefile: the files which have to be
+ checked for existance are named foo.rNNN and not just foo.NNN
+
+ *) Fixed a typo related to a RAND_status call in ssl_engine_rand.c
+ which was introduced in 2.6.1 and which caused mod_ssl fail to
+ compile if OpenSSL >= 0.9.5 was used [Sorry, my gcc hasn't catched
+ this typo :-(...]
+
+ *) Added also some random files which exists under Mach/Rhapshody
+ platforms to the list of files in src/support/mkcert.sh to make
+ sure enough entropy is available on these platforms under "make
+ certificate" with OpenSSL 0.9.5
+
+ *) Enhanced SSLRequire (SH2) -> SSLRequireSSL (mod_ssl)
+ directive compatibility mapping.
+
+ Changes with mod_ssl 2.6.1 (25-Feb-2000 to 29-Feb-2000)
+
+ *) Added support for OpenSSL 0.9.5's RAND_egd() which is now used
+ to read entropy from the EGD Unix domain socket if `SSLRandSeed
+ egd:/path/to/socket' is configured.
+
+ *) Extended builtin PRNG seeding with a run-time stack based source.
+ This way the builtin source now creates more entropy and usually
+ enough to make OpenSSL >= 0.9.5 happy again. If OpenSSL is still not
+ happy (i.e. still not sufficient entropy exists), a warning message
+ is logged by mod_ssl now.
+
+ *) Fixed Tanenbaum's name on the quote in ssl_intro.wml
+
+ *) Updated Thawte's sxnet stuff for latest OpenSSL.
+
+ *) Allow mod_ssl to compile also under Win32 & VC++ 6.0
+
+ *) Fix OS/2 support and this way make mod_ssl again work
+ also under this platform.
+
+ Changes with mod_ssl 2.6.0 (24-Feb-2000 to 25-Feb-2000)
+
+ *) Merged in enhanced HTTPS Proxy Support which is derived from
+ Stronghold 2.x and was originally contributed by C2Net over one
+ year ago. This is still _EXPERIMENTAL_ stuff, so it is entirely
+ wrapped with SSL_EXPERIMENTAL sections and has to be abled under
+ built-time with --enable-rule=SSL_EXPERIMENTAL. Then the following
+ new configuration directives are provided to fine-tune the HTTPS
+ proxy support:
+
+ o SSLProxyProtocol [+-][SSLv2|SSLv3|TLSv1] ...
+ (enable or disable SSL protocol flavors)
+ o SSLProxyCipherSuite XXX:...:XXX
+ (colon-delimited list of permitted SSL ciphers)
+ o SSLProxyVerify on|off
+ (whether to verify the remote certificate)
+ o SSLProxyVerifyDepth N
+ (maximum certificate verification depth)
+ o SSLProxyCACertificateFile /path/to/file
+ (file containing server certificates)
+ o SSLProxyCACertificatePath /path/to/dir
+ (directory containing server certificates)
+ o SSLProxyMachineCertificateFile /path/to/file
+ (file containing client certificates)
+ o SSLProxyMachineCertificatePath /path/to/dir
+ (directory containing client certificates)
+
+ This stuff is declared experimental, because it was still _NOT_
+ tested in depth and is still _UNDOCUMENTED_. So keep in mind what
+ SSL_EXPERIMENTAL means and use this with care!
+
+ *) Extended the EAPI patches to mod_proxy to allow the new
+ HTTPS proxy support to be merged in.
+
+ *) Fixed ssl_io_suck() prototype scope in mod_ssl.h by changing
+ the old #ifdef SSL_EXPERIMENTAL to the now correct #ifndef
+ SSL_CONSERVATIVE.
+
+ *) Added "cons" and "nocons" development target to
+ src/modules/ssl/Makefile.tmpl.
+
+ *) Upgraded to Apache version 1.3.12.
+
+
____ ____
|___ \ | ___|
__) | |___ \
/ __/ _ ___) |
__ |_____(_)____/___________________________________________
+ Changes with mod_ssl 2.5.1 (22-Jan-2000 to 24-Feb-2000)
+
+ *) Made sure OpenSSL's Pseudo Random Number Generator (PRNG) is
+ seeded already before the temporary RSA keys are generated.
+
+ *) Fixed possible security hole in mkcert.sh script (make
+ certificate) by making sure we already generate the foo.key files
+ with proper umask instead of chmod them later (and this way
+ perhaps too late).
+
+ *) Fixed memory leak caused by not-freed SSL_CTX in the HTTPS proxy
+ support (ssl_engine_ext.c/mod_proxy).
+
+ *) Fixed quotation author in ssl_glossary.html: it's Richard Nixon,
+ as Lukas Bradley pointed out.
+
+ *) Use "/usr/local/ssl" as the default for $SSL_BASE only if this
+ path really exists. Else use "SYSTEM" and this way be more
+ flexible. This is especially interesting for RedHat/RPM users
+ where OpenSSL stays often directly under /usr.
+
+ *) Make sure libssl.module also detects OpenSSL correctly
+ if OpenSSL was built as shared libraries (.so)
+
+ *) Let configure script more accurately check for -h, -v and
+ -q options on command line.
+
+ *) Make `SSLSessionCache none' really work as expected.
+
+ *) Added support for the latest OpenSSL snapshot (>= version 0.9.4).
+
+ *) Removed the removal of "#ifdef lint.. #endif" lines from
+ src/modules/ssl/Makefile.tmpl to make the life of the
+ OpenBSD guys easier in the future.
+
+ *) Removed Unix Bourne-Shell construct "2>&1" from Win32's
+ configure.bat script because Win32 hates this.
+
+ *) Fixed ApacheCore.def for Win32: Some numbers occured
+ multiple times.
+
Changes with mod_ssl 2.5.0 (08-Jan-2000 to 22-Jan-2000)
*) Switched the old "POST for HTTPS" support code from
diff --git a/usr.sbin/httpd/src/Configure b/usr.sbin/httpd/src/Configure
index f397c14aa0f..73896039b12 100644
--- a/usr.sbin/httpd/src/Configure
+++ b/usr.sbin/httpd/src/Configure
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: Configure,v 1.10 2000/01/28 18:39:57 beck Exp $
+# $OpenBSD: Configure,v 1.11 2000/03/19 11:16:52 beck Exp $
## ====================================================================
## Copyright (c) 1995-1999 The Apache Group. All rights reserved.
##
@@ -678,10 +678,17 @@ case "$PLAT" in
LIBS="$LIBS -lPW"
;;
*-uts*)
- OS='Amdahl UTS'
- CFLAGS="$CFLAGS -Xa -eft -DUTS21 -DUSEBCOPY"
- LIBS="$LIBS -lsocket -lbsd -la"
- DEF_WANTHSREGEX=yes
+ PLATOSVERS=`echo $PLAT | sed 's/^.*,//'`
+ OS='Amdahl UTS $PLATOSVERS'
+ case "$PLATOSVERS" in
+ 2*) CFLAGS="$CFLAGS -Xa -eft -DUTS21 -DUSEBCOPY"
+ LIBS="$LIBS -lsocket -lbsd -la"
+ DEF_WANTHSREGEX=yes
+ ;;
+ *) CFLAGS="$CFLAGS -Xa -DSVR4"
+ LIBS="$LIBS -lsocket -lnsl"
+ ;;
+ esac
;;
*-ultrix)
OS='ULTRIX'
@@ -1221,7 +1228,7 @@ if [ "x$using_shlib" = "x1" ] ; then
# Older SINIX machines must be linked as "shared core"-Apache
case $CC in
*/gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
- */cc|cc ) CFLAGS_SHLIB="-KPIC" ;;
+ *) CFLAGS_SHLIB="-KPIC" ;;
esac
LDFLAGS_SHLIB="-G"
LDFLAGS_MOD_SHLIB=$LDFLAGS_SHLIB
@@ -1843,7 +1850,7 @@ if [ "x$using_shlib" = "x1" ] ; then
# select the special subtarget for shared core generation
SUBTARGET=target_shared
# determine additional suffixes for libhttpd.so
- V=1 R=3 P=11
+ V=1 R=3 P=12
if [ "x$SHLIB_SUFFIX_DEPTH" = "x0" ]; then
SHLIB_SUFFIX_LIST=""
fi
diff --git a/usr.sbin/httpd/src/ap/ap_getpass.c b/usr.sbin/httpd/src/ap/ap_getpass.c
index 9ed6897d6b3..0cd59f4c345 100644
--- a/usr.sbin/httpd/src/ap/ap_getpass.c
+++ b/usr.sbin/httpd/src/ap/ap_getpass.c
@@ -84,7 +84,7 @@
#define ERR_OVERFLOW 5
-#ifdef MPE
+#if defined(MPE) || defined(BEOS)
#include
char *
diff --git a/usr.sbin/httpd/src/helpers/binbuild.sh b/usr.sbin/httpd/src/helpers/binbuild.sh
index 9d44b6a5e9d..1e2f454ff03 100644
--- a/usr.sbin/httpd/src/helpers/binbuild.sh
+++ b/usr.sbin/httpd/src/helpers/binbuild.sh
@@ -229,7 +229,7 @@ cp README.bindist ../apache_$VER-$OS.README
echo " " && \
echo "echo \"Ready.\"" && \
echo "echo \" +--------------------------------------------------------+\"" && \
- echo "echo \" | You now have successfully installed the Apache $VER |\"" && \
+ echo "echo \" | You now have successfully installed the Apache $VER |\"" && \
echo "echo \" | HTTP server. To verify that Apache actually works |\"" && \
echo "echo \" | correctly you should first check the (initially |\"" && \
echo "echo \" | created or preserved) configuration files: |\"" && \
diff --git a/usr.sbin/httpd/src/include/ap_config.h b/usr.sbin/httpd/src/include/ap_config.h
index 5ea94b88a4d..f60be1c3b5e 100644
--- a/usr.sbin/httpd/src/include/ap_config.h
+++ b/usr.sbin/httpd/src/include/ap_config.h
@@ -812,6 +812,7 @@ typedef int rlim_t;
#define NO_RELIABLE_PIPED_LOGS
#define USE_OS2SEM_SERIALIZED_ACCEPT
#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
+#define FOPEN_REQUIRES_T
#elif defined(__MACHTEN__)
typedef int rlim_t;
diff --git a/usr.sbin/httpd/src/include/ap_mmn.h b/usr.sbin/httpd/src/include/ap_mmn.h
index e34607926f6..bb043ad0c7f 100644
--- a/usr.sbin/httpd/src/include/ap_mmn.h
+++ b/usr.sbin/httpd/src/include/ap_mmn.h
@@ -226,6 +226,7 @@
* ap_base64encode_len(), ap_base64decode(),
* ap_base64decode_binary(), ap_base64decode_len(),
* ap_pbase64decode(), ap_pbase64encode()
+ * 19990320.7 - add ap_strcasestr()
*/
/*
@@ -249,7 +250,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 19990320
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 7 /* 0...n */
#define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR /* backward compat */
/* Useful for testing for features. */
diff --git a/usr.sbin/httpd/src/include/http_core.h b/usr.sbin/httpd/src/include/http_core.h
index 459fd248f35..81cd3c8be60 100644
--- a/usr.sbin/httpd/src/include/http_core.h
+++ b/usr.sbin/httpd/src/include/http_core.h
@@ -243,6 +243,15 @@ typedef struct {
*/
unsigned d_is_fnmatch : 1;
+ /* should we force a charset on any outgoing parameterless content-type?
+ * if so, which charset?
+ */
+#define ADD_DEFAULT_CHARSET_OFF (0)
+#define ADD_DEFAULT_CHARSET_ON (1)
+#define ADD_DEFAULT_CHARSET_UNSET (2)
+ unsigned add_default_charset : 2;
+ char *add_default_charset_name;
+
/* System Resource Control */
#ifdef RLIMIT_CPU
struct rlimit *limit_cpu;
diff --git a/usr.sbin/httpd/src/include/httpd.h b/usr.sbin/httpd/src/include/httpd.h
index 9ad91305f5a..d817ac4f628 100644
--- a/usr.sbin/httpd/src/include/httpd.h
+++ b/usr.sbin/httpd/src/include/httpd.h
@@ -269,7 +269,7 @@ extern "C" {
/* The path to the suExec wrapper, can be overridden in Configuration */
#ifndef SUEXEC_BIN
-#define SUEXEC_BIN HTTPD_ROOT "/sbin/suexec"
+#define SUEXEC_BIN HTTPD_ROOT "/bin/suexec"
#endif
/* The default string lengths */
@@ -438,6 +438,12 @@ extern "C" {
#define DEFAULT_LIMIT_REQUEST_FIELDS 100
#endif /* default limit on number of request header fields */
+/*
+ * The default default character set name to add if AddDefaultCharset is
+ * enabled. Overridden with AddDefaultCharsetName.
+ */
+#define DEFAULT_ADD_DEFAULT_CHARSET_NAME "iso-8859-1"
+
/*
* The below defines the base string of the Server: header. Additional
* tokens can be added via the ap_add_version_component() API call.
@@ -451,7 +457,7 @@ extern "C" {
* Example: "Apache/1.1.0 MrWidget/0.1-alpha"
*/
-#define SERVER_BASEVERSION "Apache/1.3.11" /* SEE COMMENTS ABOVE */
+#define SERVER_BASEVERSION "Apache/1.3.12" /* SEE COMMENTS ABOVE */
#define SERVER_VERSION SERVER_BASEVERSION
enum server_token_type {
SrvTk_MIN, /* eg: Apache/1.3.0 */
@@ -470,7 +476,7 @@ API_EXPORT(void) ap_add_config_define(const char *define);
* Always increases along the same track as the source branch.
* For example, Apache 1.4.2 would be '10402100', 2.5b7 would be '20500007'.
*/
-#define APACHE_RELEASE 10311100
+#define APACHE_RELEASE 10312100
#define SERVER_PROTOCOL "HTTP/1.1"
#ifndef SERVER_SUPPORT
@@ -1046,6 +1052,7 @@ API_EXPORT(char *) ap_make_full_path(pool *a, const char *dir, const char *f);
API_EXPORT(int) ap_is_matchexp(const char *str);
API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp);
API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp);
+API_EXPORT(char *) ap_strcasestr(const char *s1, const char *s2);
API_EXPORT(char *) ap_pbase64decode(pool *p, const char *bufcoded);
API_EXPORT(char *) ap_pbase64encode(pool *p, char *string);
API_EXPORT(char *) ap_uudecode(pool *p, const char *bufcoded);
diff --git a/usr.sbin/httpd/src/main/http_core.c b/usr.sbin/httpd/src/main/http_core.c
index 8c11f1771f8..4c4c64d275d 100644
--- a/usr.sbin/httpd/src/main/http_core.c
+++ b/usr.sbin/httpd/src/main/http_core.c
@@ -154,6 +154,9 @@ static void *create_core_dir_config(pool *a, char *dir)
conf->server_signature = srv_sig_unset;
+ conf->add_default_charset = ADD_DEFAULT_CHARSET_UNSET;
+ conf->add_default_charset_name = DEFAULT_ADD_DEFAULT_CHARSET_NAME;
+
return (void *)conf;
}
@@ -281,6 +284,14 @@ static void *merge_core_dir_configs(pool *a, void *basev, void *newv)
conf->server_signature = new->server_signature;
}
+ if (new->add_default_charset != ADD_DEFAULT_CHARSET_UNSET) {
+ conf->add_default_charset = new->add_default_charset;
+ }
+
+ if (new->add_default_charset_name) {
+ conf->add_default_charset_name = new->add_default_charset_name;
+ }
+
return (void*)conf;
}
@@ -1035,6 +1046,27 @@ static const char *set_gprof_dir(cmd_parms *cmd, void *dummy, char *arg)
}
#endif /*GPROF*/
+static const char *set_add_default_charset(cmd_parms *cmd,
+ core_dir_config *d, char *arg)
+{
+ const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT);
+ if (err != NULL) {
+ return err;
+ }
+ if (!strcasecmp(arg, "Off")) {
+ d->add_default_charset = ADD_DEFAULT_CHARSET_OFF;
+ }
+ else if (!strcasecmp(arg, "On")) {
+ d->add_default_charset = ADD_DEFAULT_CHARSET_ON;
+ d->add_default_charset_name = DEFAULT_ADD_DEFAULT_CHARSET_NAME;
+ }
+ else {
+ d->add_default_charset = ADD_DEFAULT_CHARSET_ON;
+ d->add_default_charset_name = arg;
+ }
+ return NULL;
+}
+
static const char *set_document_root(cmd_parms *cmd, void *dummy, char *arg)
{
void *sconf = cmd->server->module_config;
@@ -2786,6 +2818,8 @@ static const command_rec core_cmds[] = {
{ "GprofDir", set_gprof_dir, NULL, RSRC_CONF, TAKE1,
"Directory to plop gmon.out files" },
#endif
+{ "AddDefaultCharset", set_add_default_charset, NULL, OR_FILEINFO,
+ TAKE1, "The name of the default charset to add to any Content-Type without one or 'Off' to disable" },
/* Old resource config file commands */
diff --git a/usr.sbin/httpd/src/main/http_log.c b/usr.sbin/httpd/src/main/http_log.c
index a4927bfb113..4a1e5fe2e72 100644
--- a/usr.sbin/httpd/src/main/http_log.c
+++ b/usr.sbin/httpd/src/main/http_log.c
@@ -487,7 +487,8 @@ API_EXPORT(void) ap_log_rerror(const char *file, int line, int level,
if (((level & APLOG_LEVELMASK) <= APLOG_WARNING)
&& (ap_table_get(r->notes, "error-notes") == NULL)) {
ap_table_setn(r->notes, "error-notes",
- ap_pvsprintf(r->pool, fmt, args));
+ ap_escape_html(r->pool, ap_pvsprintf(r->pool, fmt,
+ args)));
}
va_end(args);
}
@@ -498,6 +499,9 @@ void ap_log_pid(pool *p, char *fname)
struct stat finfo;
static pid_t saved_pid = -1;
pid_t mypid;
+#ifndef WIN32
+ mode_t u;
+#endif
if (!fname)
return;
@@ -519,12 +523,19 @@ void ap_log_pid(pool *p, char *fname)
);
}
+#ifndef WIN32
+ u = umask(022);
+ (void) umask(u | 022);
+#endif
if(!(pid_file = fopen(fname, "w"))) {
perror("fopen");
fprintf(stderr, "%s: could not log pid to file %s\n",
ap_server_argv0, fname);
exit(1);
}
+#ifndef WIN32
+ (void) umask(u);
+#endif
fprintf(pid_file, "%ld\n", (long)mypid);
fclose(pid_file);
saved_pid = mypid;
diff --git a/usr.sbin/httpd/src/main/http_main.c b/usr.sbin/httpd/src/main/http_main.c
index 839f3c60f04..6442b24941b 100644
--- a/usr.sbin/httpd/src/main/http_main.c
+++ b/usr.sbin/httpd/src/main/http_main.c
@@ -1629,7 +1629,7 @@ API_EXPORT(void) ap_unregister_other_child(void *data)
for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) {
if ((*pocr)->data == data) {
nocr = (*pocr)->next;
- (*(*pocr)->maintenance) (OC_REASON_UNREGISTER, (*pocr)->data, -1);
+ (*(*pocr)->maintenance) (OC_REASON_UNREGISTER, (*pocr)->data, (ap_wait_t)-1);
*pocr = nocr;
/* XXX: um, well we've just wasted some space in pconf ? */
return;
@@ -1685,7 +1685,7 @@ static void probe_writable_fds(void)
continue;
if (FD_ISSET(ocr->write_fd, &writable_fds))
continue;
- (*ocr->maintenance) (OC_REASON_UNWRITABLE, ocr->data, -1);
+ (*ocr->maintenance) (OC_REASON_UNWRITABLE, ocr->data, (ap_wait_t)-1);
}
}
@@ -2507,16 +2507,16 @@ static void reclaim_child_processes(int terminate)
waitret = waitpid(ocr->pid, &status, WNOHANG);
if (waitret == ocr->pid) {
ocr->pid = -1;
- (*ocr->maintenance) (OC_REASON_DEATH, ocr->data, status);
+ (*ocr->maintenance) (OC_REASON_DEATH, ocr->data, (ap_wait_t)status);
}
else if (waitret == 0) {
- (*ocr->maintenance) (OC_REASON_RESTART, ocr->data, -1);
+ (*ocr->maintenance) (OC_REASON_RESTART, ocr->data, (ap_wait_t)-1);
++not_dead_yet;
}
else if (waitret == -1) {
/* uh what the heck? they didn't call unregister? */
ocr->pid = -1;
- (*ocr->maintenance) (OC_REASON_LOST, ocr->data, -1);
+ (*ocr->maintenance) (OC_REASON_LOST, ocr->data, (ap_wait_t)-1);
}
}
#endif
@@ -5078,6 +5078,11 @@ int REALMAIN(int argc, char *argv[])
child_timeouts = !ap_standalone || one_process;
+#ifdef BEOS
+ /* make sure we're running in single_process mode - Yuck! */
+ one_process = 1;
+#endif
+
#ifndef TPF
if (ap_standalone) {
ap_open_logs(server_conf, plog);
diff --git a/usr.sbin/httpd/src/main/http_protocol.c b/usr.sbin/httpd/src/main/http_protocol.c
index 1622f08aaa0..76db20ad67b 100644
--- a/usr.sbin/httpd/src/main/http_protocol.c
+++ b/usr.sbin/httpd/src/main/http_protocol.c
@@ -103,6 +103,43 @@
#endif /*CHARSET_EBCDIC*/
+/*
+ * Builds the content-type that should be sent to the client from the
+ * content-type specified. The following rules are followed:
+ * - if type is NULL, type is set to ap_default_type(r)
+ * - if charset adding is disabled, stop processing and return type.
+ * - then, if there are no parameters on type, add the default charset
+ * - return type
+ */
+static const char *make_content_type(request_rec *r, const char *type) {
+ char *needcset[] = {
+ "text/plain",
+ "text/html",
+ NULL };
+ char **pcset;
+ core_dir_config *conf = (core_dir_config *)ap_get_module_config(
+ r->per_dir_config, &core_module);
+ if (!type) type = ap_default_type(r);
+ if (conf->add_default_charset != ADD_DEFAULT_CHARSET_ON) return type;
+
+ if (ap_strcasestr(type, "charset=") != NULL) {
+ /* already has parameter, do nothing */
+ /* XXX we don't check the validity */
+ ;
+ } else {
+ /* see if it makes sense to add the charset. At present,
+ * we only add it if the Content-type is one of needcset[]
+ */
+ for (pcset = needcset; *pcset ; pcset++)
+ if (ap_strcasestr(type, *pcset) != NULL) {
+ type = ap_pstrcat(r->pool, type, "; charset=",
+ conf->add_default_charset_name, NULL);
+ break;
+ }
+ }
+ return type;
+}
+
static int parse_byterange(char *range, long clength, long *start, long *end)
{
char *dash = strchr(range, '-');
@@ -265,7 +302,7 @@ static int internal_byterange(int realreq, long *tlength, request_rec *r,
}
if (r->byterange > 1) {
- const char *ct = r->content_type ? r->content_type : ap_default_type(r);
+ const char *ct = make_content_type(r, r->content_type);
char ts[MAX_STRING_LEN];
ap_snprintf(ts, sizeof(ts), "%ld-%ld/%ld", range_start, range_end,
@@ -929,7 +966,7 @@ static void get_mime_headers(request_rec *r)
r->status = HTTP_BAD_REQUEST;
ap_table_setn(r->notes, "error-notes", ap_pstrcat(r->pool,
"Size of a request header field exceeds server limit.\n"
- " \n", field, " \n", NULL));
+ "\n", ap_escape_html(r->pool, field), " \n", NULL));
return;
}
copy = ap_palloc(r->pool, len + 1);
@@ -939,7 +976,7 @@ static void get_mime_headers(request_rec *r)
r->status = HTTP_BAD_REQUEST; /* or abort the bad request */
ap_table_setn(r->notes, "error-notes", ap_pstrcat(r->pool,
"Request header field is missing colon separator.\n"
- " \n", copy, " \n", NULL));
+ "\n", ap_escape_html(r->pool, copy), " \n", NULL));
return;
}
@@ -1645,10 +1682,8 @@ API_EXPORT(void) ap_send_http_header(request_rec *r)
ap_table_setn(r->headers_out, "Content-Type",
ap_pstrcat(r->pool, "multipart", use_range_x(r) ? "/x-" : "/",
"byteranges; boundary=", r->boundary, NULL));
- else if (r->content_type)
- ap_table_setn(r->headers_out, "Content-Type", r->content_type);
- else
- ap_table_setn(r->headers_out, "Content-Type", ap_default_type(r));
+ else ap_table_setn(r->headers_out, "Content-Type", make_content_type(r,
+ r->content_type));
if (r->content_encoding)
ap_table_setn(r->headers_out, "Content-Encoding", r->content_encoding);
@@ -2559,7 +2594,7 @@ API_EXPORT(void) ap_send_error_response(request_rec *r, int recursive_error)
r->content_languages = NULL;
r->content_encoding = NULL;
r->clength = 0;
- r->content_type = "text/html";
+ r->content_type = "text/html; charset=iso-8859-1";
if ((status == METHOD_NOT_ALLOWED) || (status == NOT_IMPLEMENTED))
ap_table_setn(r->headers_out, "Allow", make_allow(r));
diff --git a/usr.sbin/httpd/src/main/util.c b/usr.sbin/httpd/src/main/util.c
index c4fff1c8138..5b8fba06d67 100644
--- a/usr.sbin/httpd/src/main/util.c
+++ b/usr.sbin/httpd/src/main/util.c
@@ -127,6 +127,8 @@ API_EXPORT(char *) ap_field_noparam(pool *p, const char *intype)
{
const char *semi;
+ if (intype == NULL) return NULL;
+
semi = strchr(intype, ';');
if (semi == NULL) {
return ap_pstrdup(p, intype);
@@ -301,6 +303,38 @@ API_EXPORT(int) ap_is_matchexp(const char *str)
return 0;
}
+/*
+ * Similar to standard strstr() but we ignore case in this version.
+ * Based on the strstr() implementation further below.
+ */
+API_EXPORT(char *) ap_strcasestr(const char *s1, const char *s2)
+{
+ char *p1, *p2;
+ if (*s2 == '\0') {
+ /* an empty s2 */
+ return((char *)s1);
+ }
+ while(1) {
+ for ( ; (*s1 != '\0') && (ap_tolower(*s1) != ap_tolower(*s2)); s1++);
+ if (*s1 == '\0') return(NULL);
+ /* found first character of s2, see if the rest matches */
+ p1 = (char *)s1;
+ p2 = (char *)s2;
+ while (ap_tolower(*++p1) == ap_tolower(*++p2)) {
+ if (*p1 == '\0') {
+ /* both strings ended together */
+ return((char *)s1);
+ }
+ }
+ if (*p2 == '\0') {
+ /* second string ended, a match */
+ break;
+ }
+ /* didn't find a match here, try starting at next character in s1 */
+ s1++;
+ }
+ return((char *)s1);
+}
/*
* Apache stub function for the regex libraries regexec() to make sure the
* whole regex(3) API is available through the Apache (exported) namespace.
@@ -807,7 +841,11 @@ API_EXPORT(configfile_t *) ap_pcfg_openfile(pool *p, const char *name)
return NULL;
}
+#ifdef FOPEN_REQUIRES_T
file = ap_pfopen(p, name, "rt");
+#else
+ file = ap_pfopen(p, name, "r");
+#endif
#ifdef DEBUG
saved_errno = errno;
ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL,
diff --git a/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c b/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c
index 2f0fa8366a0..18312aea94e 100644
--- a/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c
+++ b/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c
@@ -87,7 +87,7 @@
* Name: digest_auth_module
* ConfigStart
- RULE_DEV_RANDOM=`sh helpers/CutRule DEV_RANDOM $file`
+ RULE_DEV_RANDOM=`./helpers/CutRule DEV_RANDOM $file`
if [ "$RULE_DEV_RANDOM" = "default" ]; then
if [ -r "/dev/random" ]; then
RULE_DEV_RANDOM="/dev/random"
diff --git a/usr.sbin/httpd/src/modules/proxy/mod_proxy.c b/usr.sbin/httpd/src/modules/proxy/mod_proxy.c
index 0587ec319f6..ea2b0da71bd 100644
--- a/usr.sbin/httpd/src/modules/proxy/mod_proxy.c
+++ b/usr.sbin/httpd/src/modules/proxy/mod_proxy.c
@@ -247,6 +247,10 @@ static int proxy_fixup(request_rec *r)
static void proxy_init(server_rec *r, pool *p)
{
ap_proxy_garbage_init(r, p);
+#ifdef EAPI
+ ap_hook_use("ap::mod_proxy::init",
+ AP_HOOK_SIG3(void,ptr,ptr), AP_HOOK_ALL, r, p);
+#endif
}
#ifdef EAPI
diff --git a/usr.sbin/httpd/src/modules/proxy/proxy_http.c b/usr.sbin/httpd/src/modules/proxy/proxy_http.c
index 78a889a6b26..b08dca9b518 100644
--- a/usr.sbin/httpd/src/modules/proxy/proxy_http.c
+++ b/usr.sbin/httpd/src/modules/proxy/proxy_http.c
@@ -189,6 +189,9 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
const char *urlptr = NULL;
const char *datestr;
struct tbl_do_args tdo;
+#ifdef EAPI
+ char *peer;
+#endif
void *sconf = r->server->module_config;
proxy_server_conf *conf =
@@ -249,12 +252,18 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
err = ap_proxy_host2addr(proxyhost, &server_hp);
if (err != NULL)
return DECLINED; /* try another */
+#ifdef EAPI
+ peer = ap_psprintf(p, "%s:%u", proxyhost, proxyport);
+#endif
}
else {
server.sin_port = htons(destport);
err = ap_proxy_host2addr(desthost, &server_hp);
if (err != NULL)
return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR, err);
+#ifdef EAPI
+ peer = ap_psprintf(p, "%s:%u", desthost, destport);
+#endif
}
sock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
@@ -315,9 +324,9 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
{
char *errmsg = NULL;
ap_hook_use("ap::mod_proxy::http::handler::new_connection",
- AP_HOOK_SIG3(ptr,ptr,ptr),
+ AP_HOOK_SIG4(ptr,ptr,ptr,ptr),
AP_HOOK_DECLINE(NULL),
- &errmsg, r, f);
+ &errmsg, r, f, peer);
if (errmsg != NULL)
return ap_proxyerror(r, HTTP_BAD_GATEWAY, errmsg);
}
diff --git a/usr.sbin/httpd/src/modules/proxy/proxy_util.c b/usr.sbin/httpd/src/modules/proxy/proxy_util.c
index 52f8f50aaee..d1d47208070 100644
--- a/usr.sbin/httpd/src/modules/proxy/proxy_util.c
+++ b/usr.sbin/httpd/src/modules/proxy/proxy_util.c
@@ -844,11 +844,15 @@ int ap_proxyerror(request_rec *r, int statuscode, const char *message)
ap_table_setn(r->notes, "error-notes",
ap_pstrcat(r->pool,
"The proxy server could not handle the request "
- "uri, "\">",
- r->method, " ", r->uri, ".\n"
- "Reason: ", message, "", NULL));
-
- /* Allow the "error-notes" string to be printed by ap_send_error_response() */
+ "pool, r->uri),
+ "\">", ap_escape_html(r->pool, r->method),
+ " ",
+ ap_escape_html(r->pool, r->uri), ". \n"
+ "Reason: ",
+ ap_escape_html(r->pool, message),
+ "", NULL));
+
+ /* Allow "error-notes" string to be printed by ap_send_error_response() */
ap_table_setn(r->notes, "verbose-error-to", ap_pstrdup(r->pool, "*"));
r->status_line = ap_psprintf(r->pool, "%3.3u Proxy Error", statuscode);
diff --git a/usr.sbin/httpd/src/modules/ssl/Makefile.tmpl b/usr.sbin/httpd/src/modules/ssl/Makefile.tmpl
index 503ad23725e..a960a3e1c1a 100644
--- a/usr.sbin/httpd/src/modules/ssl/Makefile.tmpl
+++ b/usr.sbin/httpd/src/modules/ssl/Makefile.tmpl
@@ -171,6 +171,16 @@ ssl_expr_parse.c ssl_expr_parse.h: ssl_expr_parse.y
sed -e 's;yy;ssl_expr_yy;g' \
ssl_expr_parse.h && rm -f y.tab.h
+nocons:
+ @$(MAKE) $(MFLAGS) $(MFLAGS_STATIC) \
+ SSL_CFLAGS="`echo $(SSL_CFLAGS) |\
+ sed -e 's;-DSSL_CONSERVATIVE;;'`" all
+
+cons:
+ @$(MAKE) $(MFLAGS) $(MFLAGS_STATIC) \
+ SSL_CFLAGS="`echo $(SSL_CFLAGS) |\
+ sed -e 's;-DSSL_CONSERVATIVE;;' \
+ -e 's;^;-DSSL_CONSERVATIVE ;'`" all
noexp:
@$(MAKE) $(MFLAGS) $(MFLAGS_STATIC) \
SSL_CFLAGS="`echo $(SSL_CFLAGS) |\
diff --git a/usr.sbin/httpd/src/modules/ssl/README b/usr.sbin/httpd/src/modules/ssl/README
index 416af28176d..4b6679efbcb 100644
--- a/usr.sbin/httpd/src/modules/ssl/README
+++ b/usr.sbin/httpd/src/modules/ssl/README
@@ -7,7 +7,7 @@
mod_ssl ``Ralf Engelschall has released an
Apache Interface to OpenSSL excellent module that integrates
http://www.modssl.org/ Apache and SSLeay.''
- Version 2.5 -- Tim J. Hudson
+ Version 2.6 -- Tim J. Hudson
SYNOPSIS
diff --git a/usr.sbin/httpd/src/modules/ssl/libssl.module b/usr.sbin/httpd/src/modules/ssl/libssl.module
index d30b2d3302d..dbb0248c20c 100644
--- a/usr.sbin/httpd/src/modules/ssl/libssl.module
+++ b/usr.sbin/httpd/src/modules/ssl/libssl.module
@@ -142,11 +142,11 @@ ConfigStart
my_rule_SSL_CONSERVATIVE=$SSL_CONSERVATIVE
my_rule_SSL_VENDOR=$SSL_VENDOR
else
- my_rule_SSL_COMPAT=`sh helpers/CutRule SSL_COMPAT $file`
- my_rule_SSL_SDBM=`sh helpers/CutRule SSL_SDBM $file`
- my_rule_SSL_EXPERIMENTAL=`sh helpers/CutRule SSL_EXPERIMENTAL $file`
- my_rule_SSL_CONSERVATIVE=`sh helpers/CutRule SSL_CONSERVATIVE $file`
- my_rule_SSL_VENDOR=`sh helpers/CutRule SSL_VENDOR $file`
+ my_rule_SSL_COMPAT=`./helpers/CutRule SSL_COMPAT $file`
+ my_rule_SSL_SDBM=`./helpers/CutRule SSL_SDBM $file`
+ my_rule_SSL_EXPERIMENTAL=`./helpers/CutRule SSL_EXPERIMENTAL $file`
+ my_rule_SSL_CONSERVATIVE=`./helpers/CutRule SSL_CONSERVATIVE $file`
+ my_rule_SSL_VENDOR=`./helpers/CutRule SSL_VENDOR $file`
fi
#
@@ -208,7 +208,7 @@ ConfigStart
if [ ".$DBM_LIB" != . ]; then
LIBS_ORIG="$LIBS"
LIBS="$LIBS $DBM_LIB"
- if sh helpers/TestCompile func dbm_open; then
+ if ./helpers/TestCompile func dbm_open; then
SSL_DBM_NAME="Configured DBM ($DBM_LIB)"
SSL_DBM_FLAG="$DBM_LIB"
fi
@@ -216,13 +216,13 @@ ConfigStart
fi
# 2. check for various vendor DBM libs
if [ ".$SSL_DBM_NAME" = . ]; then
- if sh helpers/TestCompile func dbm_open; then
+ if ./helpers/TestCompile func dbm_open; then
SSL_DBM_NAME='Vendor DBM (libc)'
SSL_DBM_FLAG=''
- elif sh helpers/TestCompile lib dbm dbm_open; then
+ elif ./helpers/TestCompile lib dbm dbm_open; then
SSL_DBM_NAME='Vendor DBM (libdbm)'
SSL_DBM_FLAG='-ldbm'
- elif sh helpers/TestCompile lib ndbm dbm_open; then
+ elif ./helpers/TestCompile lib ndbm dbm_open; then
SSL_DBM_NAME='Vendor DBM (libndbm)'
SSL_DBM_FLAG='-lndbm'
fi
@@ -272,7 +272,11 @@ ConfigStart
if [ ".$SSL_BASE" = . ]; then
SSL_BASE=`egrep '^SSL_BASE=' $file | tail -1 | awk -F= '{print $2}'`
if [ ".$SSL_BASE" = . ]; then
- SSL_BASE="/usr/local/ssl"
+ if [ -d /usr/local/ssl ]; then
+ SSL_BASE="/usr/local/ssl"
+ else
+ SSL_BASE="SYSTEM"
+ fi
fi
fi
case $SSL_BASE in
@@ -391,10 +395,10 @@ ConfigStart
exit 1
fi
else
- if [ -f "$SSL_BASE/libssl.a" ]; then
+ if [ -f "$SSL_BASE/libssl.a" -o -f "$SSL_BASE/libssl.so" ]; then
SSL_LIBDIR='$(SSL_BASE)'
my_real_ssl_libdir="$SSL_BASE"
- elif [ -f "$SSL_BASE/lib/libssl.a" ]; then
+ elif [ -f "$SSL_BASE/lib/libssl.a" -o -f "$SSL_BASE/lib/libssl.so" ]; then
SSL_LIBDIR='$(SSL_BASE)/lib'
my_real_ssl_libdir="$SSL_BASE/lib"
else
diff --git a/usr.sbin/httpd/src/modules/ssl/libssl.version b/usr.sbin/httpd/src/modules/ssl/libssl.version
index 352a795ba42..f772c9fffa1 100644
--- a/usr.sbin/httpd/src/modules/ssl/libssl.version
+++ b/usr.sbin/httpd/src/modules/ssl/libssl.version
@@ -1 +1 @@
-mod_ssl/2.5.0-1.3.11
+mod_ssl/2.6.2-1.3.12
diff --git a/usr.sbin/httpd/src/modules/ssl/mod_ssl.c b/usr.sbin/httpd/src/modules/ssl/mod_ssl.c
index 92ebad83622..d872b6701e4 100644
--- a/usr.sbin/httpd/src/modules/ssl/mod_ssl.c
+++ b/usr.sbin/httpd/src/modules/ssl/mod_ssl.c
@@ -74,7 +74,7 @@
* identify the module to SCCS `what' and RCS `ident' commands
*/
static char const sccsid[] = "@(#) mod_ssl/" MOD_SSL_VERSION " >";
-static char const rcsid[] = "$Id: mod_ssl.c,v 1.3 2000/01/25 18:29:53 beck Exp $";
+static char const rcsid[] = "$Id: mod_ssl.c,v 1.4 2000/03/19 11:17:20 beck Exp $";
/*
* the table of configuration directives we provide
@@ -154,6 +154,36 @@ static command_rec ssl_config_cmds[] = {
"Enable or disable various SSL protocols"
"(`[+-][SSLv2|SSLv3|TLSv1] ...' - see manual)")
+#ifdef SSL_EXPERIMENTAL
+ /*
+ * Proxy configuration for remote SSL connections
+ */
+ AP_SRV_CMD(ProxyProtocol, RAW_ARGS,
+ "SSL Proxy: enable or disable SSL protocol flavors "
+ "(`[+-][SSLv2|SSLv3|TLSv1] ...' - see manual)")
+ AP_SRV_CMD(ProxyCipherSuite, TAKE1,
+ "SSL Proxy: colon-delimited list of permitted SSL ciphers "
+ "(`XXX:...:XXX' - see manual)")
+ AP_SRV_CMD(ProxyVerify, FLAG,
+ "SSL Proxy: whether to verify the remote certificate "
+ "(`on' or `off')")
+ AP_SRV_CMD(ProxyVerifyDepth, TAKE1,
+ "SSL Proxy: maximum certificate verification depth "
+ "(`N' - number of intermediate certificates)")
+ AP_SRV_CMD(ProxyCACertificateFile, TAKE1,
+ "SSL Proxy: file containing server certificates "
+ "(`/path/to/file' - PEM encoded certificates)")
+ AP_SRV_CMD(ProxyCACertificatePath, TAKE1,
+ "SSL Proxy: directory containing server certificates "
+ "(`/path/to/dir' - contains PEM encoded certificates)")
+ AP_SRV_CMD(ProxyMachineCertificateFile, TAKE1,
+ "SSL Proxy: file containing client certificates "
+ "(`/path/to/file' - PEM encoded certificates)")
+ AP_SRV_CMD(ProxyMachineCertificatePath, TAKE1,
+ "SSL Proxy: directory containing client certificates "
+ "(`/path/to/dir' - contains PEM encoded certificates)")
+#endif
+
/*
* Per-directory context configuration directives
*/
diff --git a/usr.sbin/httpd/src/modules/ssl/mod_ssl.h b/usr.sbin/httpd/src/modules/ssl/mod_ssl.h
index d564b66406c..3725844c3d0 100644
--- a/usr.sbin/httpd/src/modules/ssl/mod_ssl.h
+++ b/usr.sbin/httpd/src/modules/ssl/mod_ssl.h
@@ -82,11 +82,15 @@
#include
#include
#include
+#include
+#include
#include
#ifndef WIN32
#include
#endif
-#include
+#ifdef WIN32
+#include
+#endif
/* OpenSSL headers */
#include
@@ -497,6 +501,9 @@ typedef enum {
SSL_RSSRC_BUILTIN = 1,
SSL_RSSRC_FILE = 2,
SSL_RSSRC_EXEC = 3
+#if SSL_LIBRARY_VERSION >= 0x00905100
+ ,SSL_RSSRC_EGD = 4
+#endif
} ssl_rssrc_t;
typedef struct {
ssl_rsctx_t nCtx;
@@ -572,6 +579,19 @@ typedef struct {
char *szCARevocationPath;
char *szCARevocationFile;
X509_STORE *pRevocationStore;
+#ifdef SSL_EXPERIMENTAL
+ /* Configuration details for proxy operation */
+ ssl_proto_t nProxyProtocol;
+ int bProxyVerify;
+ int nProxyVerifyDepth;
+ char *szProxyCACertificatePath;
+ char *szProxyCACertificateFile;
+ char *szProxyClientCertificateFile;
+ char *szProxyClientCertificatePath;
+ char *szProxyCipherSuite;
+ SSL_CTX *pSSLProxyCtx;
+ STACK_OF(X509_INFO) *skProxyClientCerts;
+#endif
#ifdef SSL_VENDOR
ap_ctx *ctx;
#endif
@@ -637,6 +657,16 @@ const char *ssl_cmd_SSLProtocol(cmd_parms *, char *, const char *);
const char *ssl_cmd_SSLOptions(cmd_parms *, SSLDirConfigRec *, const char *);
const char *ssl_cmd_SSLRequireSSL(cmd_parms *, SSLDirConfigRec *, char *);
const char *ssl_cmd_SSLRequire(cmd_parms *, SSLDirConfigRec *, char *);
+#ifdef SSL_EXPERIMENTAL
+const char *ssl_cmd_SSLProxyProtocol(cmd_parms *, char *, const char *);
+const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *, char *, char *);
+const char *ssl_cmd_SSLProxyVerify(cmd_parms *, char *, int);
+const char *ssl_cmd_SSLProxyVerifyDepth(cmd_parms *, char *, char *);
+const char *ssl_cmd_SSLProxyCACertificatePath(cmd_parms *, char *, char *);
+const char *ssl_cmd_SSLProxyCACertificateFile(cmd_parms *, char *, char *);
+const char *ssl_cmd_SSLProxyMachineCertificatePath(cmd_parms *, char *, char *);
+const char *ssl_cmd_SSLProxyMachineCertificateFile(cmd_parms *, char *, char *);
+#endif
/* module initialization */
void ssl_init_Module(server_rec *, pool *);
@@ -753,12 +783,12 @@ char *ssl_var_lookup(pool *, server_rec *, conn_rec *, request_rec *, cha
void ssl_io_register(void);
void ssl_io_unregister(void);
long ssl_io_data_cb(BIO *, int, const char *, int, long, long);
-#ifdef SSL_EXPERIMENTAL
+#ifndef SSL_CONSERVATIVE
void ssl_io_suck(request_rec *, SSL *);
#endif
/* PRNG */
-int ssl_rand_seed(server_rec *, pool *, ssl_rsctx_t);
+int ssl_rand_seed(server_rec *, pool *, ssl_rsctx_t, char *);
/* Extensions */
void ssl_ext_register(void);
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_compat.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_compat.c
index de92ab89574..1f44f4440d9 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_compat.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_compat.c
@@ -78,6 +78,7 @@
* The mapping of obsolete directives to official ones...
*/
+static char *ssl_compat_RequireSSL(pool *, const char *, const char *, const char *);
static char *ssl_compat_SSLSessionLockFile(pool *, const char *, const char *, const char *);
static char *ssl_compat_SSLCacheDisable(pool *, const char *, const char *, const char *);
static char *ssl_compat_SSLRequireCipher(pool *, const char *, const char *, const char *);
@@ -152,23 +153,39 @@ static struct {
CRM_ENTRY( CRM_CMD("SSLClientCAfile"), CRM_SUB("SSLCACertificateFile") )
CRM_ENTRY( CRM_CMD("SSLSessionLockFile"), CRM_CAL(ssl_compat_SSLSessionLockFile) )
CRM_ENTRY( CRM_CMD("SSLCacheDisable"), CRM_CAL(ssl_compat_SSLCacheDisable) )
- CRM_ENTRY( CRM_CMD("RequireSSL"), CRM_SUB("SSLRequireSSL") )
+ CRM_ENTRY( CRM_CMD("RequireSSL"), CRM_CAL(ssl_compat_RequireSSL) )
CRM_ENTRY( CRM_CMD("SSLCipherList"), CRM_SUB("SSLCipherSuite") )
CRM_ENTRY( CRM_CMD("SSLErrorFile"), CRM_LOG("Not needed for mod_ssl") )
CRM_ENTRY( CRM_CMD("SSLRoot"), CRM_LOG("Not supported by mod_ssl") )
CRM_ENTRY( CRM_CMD("SSL_CertificateLogDir"), CRM_LOG("Not supported by mod_ssl") )
CRM_ENTRY( CRM_CMD("AuthCertDir"), CRM_LOG("Not supported by mod_ssl") )
CRM_ENTRY( CRM_CMD("SSL_Group"), CRM_LOG("Not supported by mod_ssl") )
+#ifndef SSL_EXPERIMENTAL
CRM_ENTRY( CRM_CMD("SSLProxyMachineCertPath"), CRM_LOG("Not supported by mod_ssl") )
CRM_ENTRY( CRM_CMD("SSLProxyMachineCertFile"), CRM_LOG("Not supported by mod_ssl") )
CRM_ENTRY( CRM_CMD("SSLProxyCACertificatePath"), CRM_LOG("Not supported by mod_ssl") )
CRM_ENTRY( CRM_CMD("SSLProxyCACertificateFile"), CRM_LOG("Not supported by mod_ssl") )
CRM_ENTRY( CRM_CMD("SSLProxyVerifyDepth"), CRM_LOG("Not supported by mod_ssl") )
CRM_ENTRY( CRM_CMD("SSLProxyCipherList"), CRM_LOG("Not supported by mod_ssl") )
+#else
+ CRM_ENTRY( CRM_CMD("SSLProxyCipherList"), CRM_SUB("SSLProxyCipherSuite") )
+#endif
CRM_END
};
+static char *ssl_compat_RequireSSL(
+ pool *p, const char *oline, const char *cmd, const char *args)
+{
+ char *cp;
+
+ for (cp = (char *)args; ap_isspace(*cp); cp++)
+ ;
+ if (strcEQ(cp, "on"))
+ return "SSLRequireSSL";
+ return "";
+}
+
static char *ssl_compat_SSLSessionLockFile(
pool *p, const char *oline, const char *cmd, const char *args)
{
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_config.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_config.c
index 3fdc86efb58..9f62ee6c216 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_config.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_config.c
@@ -206,6 +206,18 @@ void *ssl_config_server_create(pool *p, server_rec *s)
sc->szCARevocationFile = NULL;
sc->pRevocationStore = NULL;
+#ifdef SSL_EXPERIMENTAL
+ sc->nProxyVerifyDepth = UNSET;
+ sc->szProxyCACertificatePath = NULL;
+ sc->szProxyCACertificateFile = NULL;
+ sc->szProxyClientCertificateFile = NULL;
+ sc->szProxyClientCertificatePath = NULL;
+ sc->szProxyCipherSuite = NULL;
+ sc->nProxyProtocol = SSL_PROTOCOL_ALL & ~SSL_PROTOCOL_TLSV1;
+ sc->bProxyVerify = UNSET;
+ sc->pSSLProxyCtx = NULL;
+#endif
+
(void)memset(sc->szPublicCertFile, 0, SSL_AIDX_MAX*sizeof(char *));
(void)memset(sc->szPrivateKeyFile, 0, SSL_AIDX_MAX*sizeof(char *));
(void)memset(sc->pPublicCert, 0, SSL_AIDX_MAX*sizeof(X509 *));
@@ -264,6 +276,18 @@ void *ssl_config_server_merge(pool *p, void *basev, void *addv)
p, base, add, new);
#endif
+#ifdef SSL_EXPERIMENTAL
+ cfgMergeInt(nProxyVerifyDepth);
+ cfgMergeString(szProxyCACertificatePath);
+ cfgMergeString(szProxyCACertificateFile);
+ cfgMergeString(szProxyClientCertificateFile);
+ cfgMergeString(szProxyClientCertificatePath);
+ cfgMergeString(szProxyCipherSuite);
+ cfgMerge(nProxyProtocol, (SSL_PROTOCOL_ALL & ~SSL_PROTOCOL_TLSV1));
+ cfgMergeBool(bProxyVerify);
+ cfgMerge(pSSLProxyCtx, NULL);
+#endif
+
return new;
}
@@ -443,6 +467,12 @@ const char *ssl_cmd_SSLRandomSeed(
pRS->nSrc = SSL_RSSRC_EXEC;
pRS->cpPath = ap_pstrdup(mc->pPool, ap_server_root_relative(cmd->pool, arg2+5));
}
+#if SSL_LIBRARY_VERSION >= 0x00905100
+ else if (strlen(arg2) > 4 && strEQn(arg2, "egd:", 4)) {
+ pRS->nSrc = SSL_RSSRC_EGD;
+ pRS->cpPath = ap_pstrdup(mc->pPool, ap_server_root_relative(cmd->pool, arg2+4));
+ }
+#endif
else if (strcEQ(arg2, "builtin")) {
pRS->nSrc = SSL_RSSRC_BUILTIN;
pRS->cpPath = NULL;
@@ -872,3 +902,133 @@ const char *ssl_cmd_SSLProtocol(
return NULL;
}
+#ifdef SSL_EXPERIMENTAL
+
+const char *ssl_cmd_SSLProxyProtocol(
+ cmd_parms *cmd, char *struct_ptr, const char *opt)
+{
+ SSLSrvConfigRec *sc;
+ ssl_proto_t options, thisopt;
+ char action;
+ char *w;
+
+ sc = mySrvConfig(cmd->server);
+ options = SSL_PROTOCOL_NONE;
+ while (opt[0] != NUL) {
+ w = ap_getword_conf(cmd->pool, &opt);
+
+ action = NUL;
+ if (*w == '+' || *w == '-')
+ action = *(w++);
+
+ if (strcEQ(w, "SSLv2"))
+ thisopt = SSL_PROTOCOL_SSLV2;
+ else if (strcEQ(w, "SSLv3"))
+ thisopt = SSL_PROTOCOL_SSLV3;
+ else if (strcEQ(w, "TLSv1"))
+ thisopt = SSL_PROTOCOL_TLSV1;
+ else if (strcEQ(w, "all"))
+ thisopt = SSL_PROTOCOL_ALL;
+ else
+ return ap_pstrcat(cmd->pool, "SSLProxyProtocol: "
+ "Illegal protocol '", w, "'", NULL);
+ if (action == '-')
+ options &= ~thisopt;
+ else if (action == '+')
+ options |= thisopt;
+ else
+ options = thisopt;
+ }
+ sc->nProxyProtocol = options;
+ return NULL;
+}
+
+const char *ssl_cmd_SSLProxyCipherSuite(
+ cmd_parms *cmd, char *struct_ptr, char *arg)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+
+ sc->szProxyCipherSuite = arg;
+ return NULL;
+}
+
+const char *ssl_cmd_SSLProxyVerify(
+ cmd_parms *cmd, char *struct_ptr, int flag)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+
+ sc->bProxyVerify = (flag ? TRUE : FALSE);
+ return NULL;
+}
+
+const char *ssl_cmd_SSLProxyVerifyDepth(
+ cmd_parms *cmd, char *struct_ptr, char *arg)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+ int d;
+
+ d = atoi(arg);
+ if (d < 0)
+ return "SSLProxyVerifyDepth: Invalid argument";
+ sc->nProxyVerifyDepth = d;
+ return NULL;
+}
+
+const char *ssl_cmd_SSLProxyCACertificateFile(
+ cmd_parms *cmd, char *struct_ptr, char *arg)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+ char *cpPath;
+
+ cpPath = ap_server_root_relative(cmd->pool, arg);
+ if (!ssl_util_path_check(SSL_PCM_EXISTS|SSL_PCM_ISREG|SSL_PCM_ISNONZERO, cpPath))
+ return ap_pstrcat(cmd->pool, "SSLProxyCACertificateFile: file '",
+ cpPath, "' not exists or empty", NULL);
+ sc->szProxyCACertificateFile = cpPath;
+ return NULL;
+}
+
+const char *ssl_cmd_SSLProxyCACertificatePath(
+ cmd_parms *cmd, char *struct_ptr, char *arg)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+ char *cpPath;
+
+ cpPath = ap_server_root_relative(cmd->pool, arg);
+ if (!ssl_util_path_check(SSL_PCM_EXISTS|SSL_PCM_ISDIR, cpPath))
+ return ap_pstrcat(cmd->pool, "SSLProxyCACertificatePath: directory '",
+ cpPath, "' does not exists", NULL);
+ sc->szProxyCACertificatePath = cpPath;
+ return NULL;
+}
+
+const char *ssl_cmd_SSLProxyMachineCertificateFile(
+ cmd_parms *cmd, char *struct_ptr, char *arg)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+ char *cpPath;
+
+ cpPath = ap_server_root_relative(cmd->pool, arg);
+ if (!ssl_util_path_check(SSL_PCM_EXISTS|SSL_PCM_ISREG|SSL_PCM_ISNONZERO, cpPath))
+ return ap_pstrcat(cmd->pool, "SSLProxyMachineCertFile: file '",
+ cpPath, "' not exists or empty", NULL);
+ sc->szProxyClientCertificateFile = cpPath;
+ return NULL;
+}
+
+const char *ssl_cmd_SSLProxyMachineCertificatePath(
+ cmd_parms *cmd, char *struct_ptr, char *arg)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+ char *cpPath;
+
+ cpPath = ap_server_root_relative(cmd->pool, arg);
+ if (!ssl_util_path_check(SSL_PCM_EXISTS|SSL_PCM_ISDIR, cpPath))
+ return ap_pstrcat(cmd->pool, "SSLProxyMachineCertPath: directory '",
+ cpPath, "' does not exists", NULL);
+ sc->szProxyClientCertificatePath = cpPath;
+ return NULL;
+}
+
+#endif /* SSL_EXPERIMENTAL */
+
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_ext.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_ext.c
index 87a550c2748..47092184c89 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_ext.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_ext.c
@@ -213,18 +213,27 @@ static char *ssl_ext_mr_lookup_variable(request_rec *r, char *var)
** _________________________________________________________________
*/
-static int ssl_ext_mp_canon(request_rec *r, char *url);
-static int ssl_ext_mp_handler(request_rec *r, void *cr, char *url, char *proxyhost, int proxyport, char *protocol);
-static int ssl_ext_mp_set_destport(request_rec *r);
-static char *ssl_ext_mp_new_connection(request_rec *r, BUFF *fb);
-static void ssl_ext_mp_close_connection(void *_fb);
-static int ssl_ext_mp_write_host_header(request_rec *r, BUFF *fb, char *host, int port, char *portstr);
+static int ssl_ext_mp_canon(request_rec *, char *);
+static int ssl_ext_mp_handler(request_rec *, void *, char *, char *, int, char *);
+static int ssl_ext_mp_set_destport(request_rec *);
+static char *ssl_ext_mp_new_connection(request_rec *, BUFF *, char *);
+static void ssl_ext_mp_close_connection(void *);
+static int ssl_ext_mp_write_host_header(request_rec *, BUFF *, char *, int, char *);
+#ifdef SSL_EXPERIMENTAL
+static void ssl_ext_mp_init(server_rec *, pool *);
+static int ssl_ext_mp_verify_cb(int, X509_STORE_CTX *);
+static int ssl_ext_mp_clientcert_cb(SSL *, X509 **, EVP_PKEY **);
+#endif
/*
* register us ...
*/
static void ssl_ext_mp_register(void)
{
+#ifdef SSL_EXPERIMENTAL
+ ap_hook_register("ap::mod_proxy::init",
+ ssl_ext_mp_init, AP_HOOK_NOCTX);
+#endif
ap_hook_register("ap::mod_proxy::canon",
ssl_ext_mp_canon, AP_HOOK_NOCTX);
ap_hook_register("ap::mod_proxy::handler",
@@ -240,6 +249,9 @@ static void ssl_ext_mp_register(void)
static void ssl_ext_mp_unregister(void)
{
+#ifdef SSL_EXPERIMENTAL
+ ap_hook_unregister("ap::mod_proxy::init", ssl_ext_mp_init);
+#endif
ap_hook_unregister("ap::mod_proxy::canon", ssl_ext_mp_canon);
ap_hook_unregister("ap::mod_proxy::handler", ssl_ext_mp_handler);
ap_hook_unregister("ap::mod_proxy::http::handler::set_destport",
@@ -251,6 +263,145 @@ static void ssl_ext_mp_unregister(void)
return;
}
+/*
+ * SSL proxy initialization
+ */
+#ifdef SSL_EXPERIMENTAL
+static void ssl_ext_mp_init(server_rec *s, pool *p)
+{
+ SSLSrvConfigRec *sc;
+ char *cpVHostID;
+ int nVerify;
+ SSL_CTX *ctx;
+ char *cp;
+ STACK_OF(X509_INFO) *sk;
+
+ /*
+ * Initialize each virtual server
+ */
+ for (; s != NULL; s = s->next) {
+ sc = mySrvConfig(s);
+ cpVHostID = ssl_util_vhostid(p, s);
+
+ if (sc->bProxyVerify == UNSET)
+ sc->bProxyVerify = FALSE;
+
+ /*
+ * Create new SSL context and configure callbacks
+ */
+ if (sc->nProxyProtocol == SSL_PROTOCOL_NONE) {
+ ssl_log(s, SSL_LOG_ERROR,
+ "Init: (%s) No Proxy SSL protocols available [hint: SSLProxyProtocol]",
+ cpVHostID);
+ ssl_die();
+ }
+ cp = ap_pstrcat(p, (sc->nProxyProtocol & SSL_PROTOCOL_SSLV2 ? "SSLv2, " : ""),
+ (sc->nProxyProtocol & SSL_PROTOCOL_SSLV3 ? "SSLv3, " : ""),
+ (sc->nProxyProtocol & SSL_PROTOCOL_TLSV1 ? "TLSv1, " : ""), NULL);
+ cp[strlen(cp)-2] = NUL;
+ ssl_log(s, SSL_LOG_TRACE,
+ "Init: (%s) Creating new proxy SSL context (protocols: %s)",
+ cpVHostID, cp);
+ if (sc->nProxyProtocol == SSL_PROTOCOL_SSLV2)
+ ctx = SSL_CTX_new(SSLv2_client_method()); /* only SSLv2 is left */
+ else
+ ctx = SSL_CTX_new(SSLv23_client_method()); /* be more flexible */
+ if (ctx == NULL) {
+ ssl_log(s, SSL_LOG_ERROR|SSL_ADD_SSLERR,
+ "Init: (%s) Unable to create SSL Proxy context", cpVHostID);
+ ssl_die();
+ }
+ sc->pSSLProxyCtx = ctx;
+ SSL_CTX_set_options(ctx, SSL_OP_ALL);
+ if (!(sc->nProxyProtocol & SSL_PROTOCOL_SSLV2))
+ SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
+ if (!(sc->nProxyProtocol & SSL_PROTOCOL_SSLV3))
+ SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3);
+ if (!(sc->nProxyProtocol & SSL_PROTOCOL_TLSV1))
+ SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1);
+
+ if (sc->szProxyClientCertificateFile || sc->szProxyClientCertificatePath) {
+ sk = sk_X509_INFO_new_null();
+ if (sc->szProxyClientCertificateFile)
+ SSL_load_CrtAndKeyInfo_file(p, sk, sc->szProxyClientCertificateFile);
+ if (sc->szProxyClientCertificatePath)
+ SSL_load_CrtAndKeyInfo_path(p, sk, sc->szProxyClientCertificatePath);
+ ssl_log(s, SSL_LOG_TRACE, "Init: (%s) loaded %d client certs for SSL proxy",
+ cpVHostID, sk_X509_INFO_num(sk));
+ if (sk_X509_INFO_num(sk) > 0) {
+ SSL_CTX_set_client_cert_cb(ctx, ssl_ext_mp_clientcert_cb);
+ sc->skProxyClientCerts = sk;
+ }
+ }
+
+ /*
+ * Calculate OpenSSL verify type for verifying the remote server
+ * certificate. We either verify it against our list of CA's, or don't
+ * bother at all.
+ */
+ nVerify = SSL_VERIFY_NONE;
+ if (sc->bProxyVerify)
+ nVerify |= SSL_VERIFY_PEER;
+ if ( nVerify & SSL_VERIFY_PEER
+ && sc->szProxyCACertificateFile == NULL
+ && sc->szProxyCACertificatePath == NULL) {
+ ssl_log(s, SSL_LOG_ERROR,
+ "Init: (%s) SSLProxyVerify set to On but no CA certificates configured",
+ cpVHostID);
+ ssl_die();
+ }
+ if ( nVerify & SSL_VERIFY_NONE
+ && ( sc->szProxyCACertificateFile != NULL
+ || sc->szProxyCACertificatePath != NULL)) {
+ ssl_log(s, SSL_LOG_WARN,
+ "init: (%s) CA certificates configured but ignored because SSLProxyVerify is Off",
+ cpVHostID);
+ }
+ SSL_CTX_set_verify(ctx, nVerify, ssl_ext_mp_verify_cb);
+
+ /*
+ * Enable session caching. We can safely use the same cache
+ * as used for communicating with the other clients.
+ */
+ SSL_CTX_sess_set_new_cb(sc->pSSLProxyCtx, ssl_callback_NewSessionCacheEntry);
+ SSL_CTX_sess_set_get_cb(sc->pSSLProxyCtx, ssl_callback_GetSessionCacheEntry);
+ SSL_CTX_sess_set_remove_cb(sc->pSSLProxyCtx, ssl_callback_DelSessionCacheEntry);
+
+ /*
+ * Configure SSL Cipher Suite
+ */
+ ssl_log(s, SSL_LOG_TRACE,
+ "Init: (%s) Configuring permitted SSL ciphers for SSL proxy", cpVHostID);
+ if (sc->szProxyCipherSuite != NULL) {
+ if (!SSL_CTX_set_cipher_list(sc->pSSLProxyCtx, sc->szProxyCipherSuite)) {
+ ssl_log(s, SSL_LOG_ERROR|SSL_ADD_SSLERR,
+ "Init: (%s) Unable to configure permitted SSL ciphers for SSL Proxy",
+ cpVHostID);
+ ssl_die();
+ }
+ }
+
+ /*
+ * Configure Client Authentication details
+ */
+ if (sc->szProxyCACertificateFile != NULL || sc->szProxyCACertificatePath != NULL) {
+ ssl_log(s, SSL_LOG_DEBUG,
+ "Init: (%s) Configuring client verification locations for SSL Proxy",
+ cpVHostID);
+ if (!SSL_CTX_load_verify_locations(sc->pSSLProxyCtx,
+ sc->szProxyCACertificateFile,
+ sc->szProxyCACertificatePath)) {
+ ssl_log(s, SSL_LOG_ERROR|SSL_ADD_SSLERR,
+ "Init: (%s) Unable to configure SSL verify locations for SSL proxy",
+ cpVHostID);
+ ssl_die();
+ }
+ }
+ }
+ return;
+}
+#endif /* SSL_EXPERIMENTAL */
+
static int ssl_ext_mp_canon(request_rec *r, char *url)
{
int rc;
@@ -289,39 +440,66 @@ static int ssl_ext_mp_set_destport(request_rec *r)
return DEFAULT_HTTP_PORT;
}
-static char *ssl_ext_mp_new_connection(request_rec *r, BUFF *fb)
+static char *ssl_ext_mp_new_connection(request_rec *r, BUFF *fb, char *peer)
{
+#ifndef SSL_EXPERIMENTAL
SSL_CTX *ssl_ctx;
+#endif
SSL *ssl;
char *errmsg;
int rc;
char *cpVHostID;
char *cpVHostMD5;
+#ifdef SSL_EXPERIMENTAL
+ SSLSrvConfigRec *sc;
+ char *cp;
+#endif
if (ap_ctx_get(r->ctx, "ssl::proxy::enabled") == PFALSE)
return NULL;
+
+ /*
+ * Find context
+ */
+#ifdef SSL_EXPERIMENTAL
+ sc = mySrvConfig(r->server);
+#endif
cpVHostID = ssl_util_vhostid(r->pool, r->server);
/*
* Create a SSL context and handle
*/
+#ifdef SSL_EXPERIMENTAL
+ ssl = SSL_new(sc->pSSLProxyCtx);
+#else
ssl_ctx = SSL_CTX_new(SSLv23_client_method());
- if ((ssl = SSL_new(ssl_ctx)) == NULL) {
- errmsg = ap_pstrcat(r->pool, "SSL new failed (%s): ", cpVHostID,
- ERR_reason_error_string(ERR_get_error()), NULL);
+ ssl = SSL_new(ssl_ctx);
+#endif
+ if (ssl == NULL) {
+ errmsg = ap_psprintf(r->pool, "SSL proxy new failed (%s): peer %s: %s",
+ cpVHostID, peer, ERR_reason_error_string(ERR_get_error()));
ap_ctx_set(fb->ctx, "ssl", NULL);
return errmsg;
}
SSL_clear(ssl);
cpVHostMD5 = ap_md5(r->pool, cpVHostID);
if (!SSL_set_session_id_context(ssl, (unsigned char *)cpVHostMD5, strlen(cpVHostMD5))) {
- errmsg = ap_pstrcat(r->pool, "Unable to set session id context to `%s': ", cpVHostMD5,
- ERR_reason_error_string(ERR_get_error()), NULL);
+ errmsg = ap_psprintf(r->pool, "Unable to set session id context to `%s': peer %s: %s",
+ cpVHostMD5, peer, ERR_reason_error_string(ERR_get_error()));
ap_ctx_set(fb->ctx, "ssl", NULL);
return errmsg;
}
SSL_set_fd(ssl, fb->fd);
+#ifdef SSL_EXPERIMENTAL
+ SSL_set_app_data(ssl, fb->ctx);
+#endif
ap_ctx_set(fb->ctx, "ssl", ssl);
+#ifdef SSL_EXPERIMENTAL
+ ap_ctx_set(fb->ctx, "ssl::proxy::server_rec", r->server);
+ ap_ctx_set(fb->ctx, "ssl::proxy::peer", peer);
+ ap_ctx_set(fb->ctx, "ssl::proxy::servername", cpVHostID);
+ ap_ctx_set(fb->ctx, "ssl::proxy::verifyerror", NULL);
+#endif
/*
* Give us a chance to gracefully close the connection
@@ -333,8 +511,19 @@ static char *ssl_ext_mp_new_connection(request_rec *r, BUFF *fb)
* Establish the SSL connection
*/
if ((rc = SSL_connect(ssl)) <= 0) {
- errmsg = ap_pstrcat(r->pool, "SSL connect failed (%s): ", cpVHostID,
- ERR_reason_error_string(ERR_get_error()), NULL);
+#ifdef SSL_EXPERIMENTAL
+ if ((cp = (char *)ap_ctx_get(fb->ctx, "ssl::proxy::verifyerror")) != NULL) {
+ SSL_set_shutdown(ssl, SSL_RECEIVED_SHUTDOWN);
+ SSL_smart_shutdown(ssl);
+ SSL_free(ssl);
+ ap_ctx_set(fb->ctx, "ssl", NULL);
+ ap_bsetflag(fb, B_EOF|B_EOUT, 1);
+ return NULL;
+ }
+#endif
+ errmsg = ap_psprintf(r->pool, "SSL proxy connect failed (%s): peer %s: %s",
+ cpVHostID, peer, ERR_reason_error_string(ERR_get_error()));
+ ssl_log(r->server, SSL_LOG_ERROR, errmsg);
SSL_free(ssl);
ap_ctx_set(fb->ctx, "ssl", NULL);
return errmsg;
@@ -347,13 +536,17 @@ static void ssl_ext_mp_close_connection(void *_fb)
{
BUFF *fb = _fb;
SSL *ssl;
+ SSL_CTX *ctx;
ssl = ap_ctx_get(fb->ctx, "ssl");
if (ssl != NULL) {
+ ctx = SSL_get_SSL_CTX(ssl);
SSL_set_shutdown(ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
SSL_smart_shutdown(ssl);
SSL_free(ssl);
ap_ctx_set(fb->ctx, "ssl", NULL);
+ if (ctx != NULL)
+ SSL_CTX_free(ctx);
}
return;
}
@@ -371,6 +564,183 @@ static int ssl_ext_mp_write_host_header(
return DECLINED;
}
+#ifdef SSL_EXPERIMENTAL
+
+/*
+ * Callback for client certificate stuff.
+ * If the remote site sent us a SSLv3 list of acceptable CA's then trawl the
+ * table of client certs and send the first one that matches.
+ */
+static int ssl_ext_mp_clientcert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
+{
+ SSLSrvConfigRec *sc;
+ X509_NAME *xnx;
+ X509_NAME *issuer;
+ X509_INFO *xi;
+ char *peer;
+ char *servername;
+ server_rec *s;
+ ap_ctx *pCtx;
+ STACK_OF(X509_NAME) *sk;
+ STACK_OF(X509_INFO) *pcerts;
+ char *cp;
+ int i, j;
+
+ pCtx = (ap_ctx *)SSL_get_app_data(ssl);
+ s = ap_ctx_get(pCtx, "ssl::proxy::server_rec");
+ peer = ap_ctx_get(pCtx, "ssl::proxy::peer");
+ servername = ap_ctx_get(pCtx, "ssl::proxy::servername");
+
+ sc = mySrvConfig(s);
+ pcerts = sc->skProxyClientCerts;
+
+ ssl_log(s, SSL_LOG_DEBUG, "Proxy client certificate callback: (%s) entered");
+
+ if ((pcerts == NULL) || (sk_X509_INFO_num(pcerts) <= 0)) {
+ ssl_log(s, SSL_LOG_TRACE,
+ "Proxy client certificate callback: (%s) "
+ "site wanted client certificate but none available",
+ servername);
+ return 0;
+ }
+
+ sk = SSL_get_client_CA_list(ssl);
+
+ if ((sk == NULL) || (sk_X509_NAME_num(sk) <= 0)) {
+ /*
+ * remote site didn't send us a list of acceptable CA certs,
+ * so lets send the first one we came across
+ */
+ xi = sk_X509_INFO_value(pcerts, 0);
+ cp = X509_NAME_oneline(X509_get_subject_name(xi->x509), NULL, 0);
+ ssl_log(s, SSL_LOG_DEBUG,
+ "SSL Proxy: (%s) no acceptable CA list, sending %s",
+ servername, cp != NULL ? cp : "-unknown-");
+ free(cp);
+ /* export structures to the caller */
+ *x509 = xi->x509;
+ *pkey = xi->x_pkey->dec_pkey;
+ /* prevent OpenSSL freeing these structures */
+ CRYPTO_add(&((*x509)->references), +1, CRYPTO_LOCK_X509_PKEY);
+ CRYPTO_add(&((*pkey)->references), +1, CRYPTO_LOCK_X509_PKEY);
+ return 1;
+ }
+
+ for (i = 0; i < sk_X509_NAME_num(sk); i++) {
+ xnx = sk_X509_NAME_value(sk, i);
+ for (j = 0; j < sk_X509_INFO_num(pcerts); j++) {
+ xi = sk_X509_INFO_value(pcerts,j);
+ issuer = X509_get_issuer_name(xi->x509);
+ if (X509_NAME_cmp(issuer, xnx) == 0) {
+ cp = X509_NAME_oneline(X509_get_subject_name(xi->x509), NULL, 0);
+ ssl_log(s, SSL_LOG_DEBUG, "SSL Proxy: (%s) sending %s",
+ servername, cp != NULL ? cp : "-unknown-");
+ free(cp);
+ /* export structures to the caller */
+ *x509 = xi->x509;
+ *pkey = xi->x_pkey->dec_pkey;
+ /* prevent OpenSSL freeing these structures */
+ CRYPTO_add(&((*x509)->references), +1, CRYPTO_LOCK_X509_PKEY);
+ CRYPTO_add(&((*pkey)->references), +1, CRYPTO_LOCK_X509_PKEY);
+ return 1;
+ }
+ }
+ }
+ ssl_log(s, SSL_LOG_TRACE,
+ "Proxy client certificate callback: (%s) "
+ "no client certificate found!?", servername);
+ return 0;
+}
+
+/*
+ * This is the verify callback when we are connecting to a remote SSL server
+ * from the proxy. Information is passed in via the SSL "ctx" app_data
+ * mechanism. We pass in an Apache context in this field, which contains
+ * server_rec of the server making the proxy connection from the
+ * "ssl::proxy::server_rec" context.
+ *
+ * The result of the verification is passed back out to SSLERR via the return
+ * value. We also store the error message in the "proxyverifyfailed" context,
+ * so the caller of SSL_connect() can log a detailed error message.
+ */
+static int ssl_ext_mp_verify_cb(int ok, X509_STORE_CTX *ctx)
+{
+ SSLSrvConfigRec *sc;
+ X509 *xs;
+ int errnum;
+ int errdepth;
+ char *cp, *cp2;
+ ap_ctx *pCtx;
+ server_rec *s;
+ SSL *ssl;
+ char *peer;
+ char *servername;
+
+ ssl = (SSL *)X509_STORE_CTX_get_app_data(ctx);
+ pCtx = (ap_ctx *)SSL_get_app_data(ssl);
+ s = ap_ctx_get(pCtx, "ssl::proxy::server_rec");
+ peer = ap_ctx_get(pCtx, "ssl::proxy::peer");
+ servername = ap_ctx_get(pCtx, "ssl::proxy::servername");
+ sc = mySrvConfig(s);
+
+ /*
+ * Get verify ingredients
+ */
+ xs = X509_STORE_CTX_get_current_cert(ctx);
+ errnum = X509_STORE_CTX_get_error(ctx);
+ errdepth = X509_STORE_CTX_get_error_depth(ctx);
+
+ /*
+ * Log verification information
+ */
+ cp = X509_NAME_oneline(X509_get_subject_name(xs), NULL, 0);
+ cp2 = X509_NAME_oneline(X509_get_issuer_name(xs), NULL, 0);
+ ssl_log(s, SSL_LOG_DEBUG,
+ "SSL Proxy: (%s) Certificate Verification for remote server %s: "
+ "depth: %d, subject: %s, issuer: %s",
+ servername, peer != NULL ? peer : "-unknown-",
+ errdepth, cp != NULL ? cp : "-unknown-",
+ cp2 != NULL ? cp2 : "-unknown");
+ free(cp);
+ free(cp2);
+
+ /*
+ * If we already know it's not ok, log the real reason
+ */
+ if (!ok) {
+ ssl_log(s, SSL_LOG_ERROR,
+ "SSL Proxy: (%s) Certificate Verification failed for %s: "
+ "Error (%d): %s", servername,
+ peer != NULL ? peer : "-unknown-",
+ errnum, X509_verify_cert_error_string(errnum));
+ ap_ctx_set(pCtx, "ssl::proxy::verifyerror",
+ (void *)X509_verify_cert_error_string(errnum));
+ return ok;
+ }
+
+ /*
+ * Check the depth of the certificate chain
+ */
+ if (sc->nProxyVerifyDepth > 0) {
+ if (errdepth > sc->nProxyVerifyDepth) {
+ ssl_log(s, SSL_LOG_ERROR,
+ "SSL Proxy: (%s) Certificate Verification failed for %s: "
+ "Certificate Chain too long "
+ "(chain has %d certificates, but maximum allowed are only %d)",
+ servername, peer, errdepth, sc->nProxyVerifyDepth);
+ ap_ctx_set(pCtx, "ssl::proxy::verifyerror",
+ (void *)X509_verify_cert_error_string(X509_V_ERR_CERT_CHAIN_TOO_LONG));
+ ok = FALSE;
+ }
+ }
+
+ /*
+ * And finally signal OpenSSL the (perhaps changed) state
+ */
+ return (ok);
+}
+
+#endif /* SSL_EXPERIMENTAL */
/* _________________________________________________________________
**
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c
index a59068780a4..0b38b9a4a94 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c
@@ -123,7 +123,6 @@ void ssl_init_Module(server_rec *s, pool *p)
SSLSrvConfigRec *sc;
server_rec *s2;
char *cp;
- int n;
mc->nInitCount++;
@@ -152,6 +151,10 @@ void ssl_init_Module(server_rec *s, pool *p)
sc->nVerifyClient = SSL_CVERIFY_NONE;
if (sc->nVerifyDepth == UNSET)
sc->nVerifyDepth = 1;
+#ifdef SSL_EXPERIMENTAL
+ if (sc->nProxyVerifyDepth == UNSET)
+ sc->nProxyVerifyDepth = 1;
+#endif
if (sc->nSessionCacheTimeout == UNSET)
sc->nSessionCacheTimeout = SSL_SESSION_CACHE_TIMEOUT;
if (sc->nPassPhraseDialogType == SSL_PPTYPE_UNSET)
@@ -265,8 +268,7 @@ void ssl_init_Module(server_rec *s, pool *p)
/*
* Seed the Pseudo Random Number Generator (PRNG)
*/
- n = ssl_rand_seed(s, p, SSL_RSCTX_STARTUP);
- ssl_log(s, SSL_LOG_INFO, "Init: Seeding PRNG with %d bytes of entropy", n);
+ ssl_rand_seed(s, p, SSL_RSCTX_STARTUP, "Init: ");
/*
* allocate the temporary RSA keys and DH params
@@ -342,12 +344,19 @@ void ssl_init_TmpKeysHandle(int action, server_rec *s, pool *p)
/* Generate Keys and Params */
if (action == SSL_TKP_GEN) {
- ssl_log(s, SSL_LOG_INFO, "Init: Generating temporary RSA private keys (512/1024 bits)");
+ /* seed PRNG */
+ ssl_rand_seed(s, p, SSL_RSCTX_STARTUP, "Init: ");
/* generate 512 bit RSA key */
+ ssl_log(s, SSL_LOG_INFO, "Init: Generating temporary RSA private keys (512/1024 bits)");
if ((rsa = RSA_generate_key(512, RSA_F4, NULL, NULL)) == NULL) {
ssl_log(s, SSL_LOG_ERROR, "Init: Failed to generate temporary 512 bit RSA private key");
+#if 0
ssl_die();
+#else
+ ssl_log(s, SSL_LOG_ERROR, "Init: You probably have no RSA support in libcrypto. See ssl(8)");
+ return;
+#endif
}
asn1 = (ssl_asn1_t *)ssl_ds_table_push(mc->tTmpKeys, "RSA:512");
asn1->nData = i2d_RSAPrivateKey(rsa, NULL);
@@ -540,7 +549,7 @@ void ssl_init_ConfigureServer(server_rec *s, pool *p, SSLSrvConfigRec *sc)
* Configure additional context ingredients
*/
SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE);
- if (mc->nSessionCacheMode == SSL_SCMODE_UNSET)
+ if (mc->nSessionCacheMode == SSL_SCMODE_NONE)
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
else
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_SERVER);
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_io.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_io.c
index fc1f0d8ee4d..2c3a4d4cee4 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_io.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_io.c
@@ -248,7 +248,7 @@ void ssl_io_suck(request_rec *r, SSL *ssl)
return;
}
-/* the SSL_read replacement routine which known about the suck buffer */
+/* the SSL_read replacement routine which knows about the suck buffer */
static int ssl_io_suck_read(SSL *ssl, char *buf, int len)
{
ap_ctx *actx;
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_kernel.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_kernel.c
index ff45e996ff1..50e9f88af9b 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_kernel.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_kernel.c
@@ -137,7 +137,6 @@ void ssl_hook_NewConnection(conn_rec *conn)
char *cpVHostMD5;
X509 *xs;
int rc;
- int n;
/*
* Get context
@@ -170,8 +169,7 @@ void ssl_hook_NewConnection(conn_rec *conn)
/*
* Seed the Pseudo Random Number Generator (PRNG)
*/
- n = ssl_rand_seed(srvr, conn->pool, SSL_RSCTX_CONNECT);
- ssl_log(srvr, SSL_LOG_TRACE, "Seeding PRNG with %d bytes of entropy", n);
+ ssl_rand_seed(srvr, conn->pool, SSL_RSCTX_CONNECT, "");
/*
* Create a new SSL connection with the configured server SSL context and
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_mutex.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_mutex.c
index 06ed510f15d..dfc4d961f59 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_mutex.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_mutex.c
@@ -156,8 +156,10 @@ void ssl_mutex_file_create(server_rec *s, pool *p)
ap_pclosef(p, mc->nMutexFD);
/* make sure the childs have access to this file */
+#ifndef OS2
if (geteuid() == 0 /* is superuser */)
chown(mc->szMutexFile, ap_user_id, -1 /* no gid change */);
+#endif
/* open the lockfile for real */
if ((mc->nMutexFD = ap_popenf(p, mc->szMutexFile,
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_rand.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_rand.c
index 2b50b438122..2af0d20b9db 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_rand.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_rand.c
@@ -74,12 +74,13 @@
static int ssl_rand_choosenum(int, int);
static int ssl_rand_feedfp(pool *, FILE *, int);
-int ssl_rand_seed(server_rec *s, pool *p, ssl_rsctx_t nCtx)
+int ssl_rand_seed(server_rec *s, pool *p, ssl_rsctx_t nCtx, char *prefix)
{
SSLModConfigRec *mc;
array_header *apRandSeed;
ssl_randseed_t *pRandSeeds;
ssl_randseed_t *pRandSeed;
+ unsigned char stackdata[256];
int nReq, nDone;
FILE *fp;
int i, n, l;
@@ -114,6 +115,17 @@ int ssl_rand_seed(server_rec *s, pool *p, ssl_rsctx_t nCtx)
nDone += ssl_rand_feedfp(p, fp, pRandSeed->nBytes);
ssl_util_ppclose(s, p, fp);
}
+#if SSL_LIBRARY_VERSION >= 0x00905100
+ else if (pRandSeed->nSrc == SSL_RSSRC_EGD) {
+ /*
+ * seed in contents provided by the external
+ * Entropy Gathering Daemon (EGD)
+ */
+ if ((n = RAND_egd(pRandSeed->cpPath)) == -1)
+ continue;
+ nDone += n;
+ }
+#endif
else if (pRandSeed->nSrc == SSL_RSSRC_BUILTIN) {
/*
* seed in the current time (usually just 4 bytes)
@@ -130,6 +142,13 @@ int ssl_rand_seed(server_rec *s, pool *p, ssl_rsctx_t nCtx)
l = sizeof(pid_t);
RAND_seed((unsigned char *)&pid, l);
nDone += l;
+
+ /*
+ * seed in some current state of the run-time stack (128 bytes)
+ */
+ n = ssl_rand_choosenum(0, sizeof(stackdata)-128-1);
+ RAND_seed(stackdata+n, 128);
+ nDone += 128;
/*
* seed in an 1KB extract of the current scoreboard
@@ -142,6 +161,12 @@ int ssl_rand_seed(server_rec *s, pool *p, ssl_rsctx_t nCtx)
}
}
}
+ ssl_log(s, SSL_LOG_INFO, "%sSeeding PRNG with %d bytes of entropy", prefix, nDone);
+
+#if SSL_LIBRARY_VERSION >= 0x00905100
+ if (RAND_status() == 0)
+ ssl_log(s, SSL_LOG_WARN, "%sPRNG still contains not sufficient entropy!", prefix);
+#endif
return nDone;
}
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_vars.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_vars.c
index c08fa8fb26f..f9a3c529f66 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_vars.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_vars.c
@@ -296,7 +296,7 @@ static char *ssl_var_lookup_ssl(pool *p, conn_rec *c, char *var)
result = ssl_var_lookup_ssl_version(p, var+8);
}
else if (ssl != NULL && strcEQ(var, "PROTOCOL")) {
- result = SSL_get_version(ssl);
+ result = (char *)SSL_get_version(ssl);
}
else if (ssl != NULL && strcEQ(var, "SESSION_ID")) {
SSL_SESSION *pSession = SSL_get_session(ssl);
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_util.c b/usr.sbin/httpd/src/modules/ssl/ssl_util.c
index bfc9e5fcc3e..ce238a52389 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_util.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_util.c
@@ -241,7 +241,7 @@ int ssl_util_ppopen_child(void *cmd, child_info *pinfo)
}
#elif defined(OS2)
/* IBM OS/2 */
- execl(SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
+ spawnl(P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
#else
/* Standard Unix */
execl(SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, NULL);
@@ -269,7 +269,7 @@ char *ssl_util_readfilter(server_rec *s, pool *p, char *cmd)
return NULL;
for (k = 0; read(fileno(fp), &c, 1) == 1
&& (k < MAX_STRING_LEN-1) ; ) {
- if (c == '\n')
+ if (c == '\n' || c == '\r')
break;
buf[k++] = c;
}
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c b/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c
index 16f9155249e..d73344abb14 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c
@@ -141,13 +141,15 @@ X509 *SSL_read_X509(FILE *fp, X509 **x509, int (*cb)())
return rc;
}
-static EVP_PKEY *d2i_PrivateKey_bio(BIO *bio, EVP_PKEY *key)
+#if SSL_LIBRARY_VERSION <= 0x00904100
+static EVP_PKEY *d2i_PrivateKey_bio(BIO *bio, EVP_PKEY **key)
{
return ((EVP_PKEY *)ASN1_d2i_bio(
(char *(*)())EVP_PKEY_new,
(char *(*)())d2i_PrivateKey,
(bio), (unsigned char **)(key)));
}
+#endif
EVP_PKEY *SSL_read_PrivateKey(FILE *fp, EVP_PKEY **key, int (*cb)())
{
@@ -388,6 +390,65 @@ BOOL SSL_X509_getCN(pool *p, X509 *xs, char **cppCN)
return FALSE;
}
+/* _________________________________________________________________
+**
+** Low-Level CA Certificate Loading
+** _________________________________________________________________
+*/
+
+#ifdef SSL_EXPERIMENTAL
+
+BOOL SSL_load_CrtAndKeyInfo_file(pool *p, STACK_OF(X509_INFO) *sk, char *filename)
+{
+ BIO *in;
+
+ if ((in = BIO_new(BIO_s_file())) == NULL)
+ return FALSE;
+ if (BIO_read_filename(in, filename) <= 0) {
+ BIO_free(in);
+ return FALSE;
+ }
+ ERR_clear_error();
+#if SSL_LIBRARY_VERSION < 0x00904000
+ PEM_X509_INFO_read_bio(in, sk, NULL);
+#else
+ PEM_X509_INFO_read_bio(in, sk, NULL, NULL);
+#endif
+ BIO_free(in);
+ return TRUE;
+}
+
+BOOL SSL_load_CrtAndKeyInfo_path(pool *p, STACK_OF(X509_INFO) *sk, char *pathname)
+{
+ struct stat st;
+ DIR *dir;
+ pool *sp;
+ struct dirent *nextent;
+ char *fullname;
+ BOOL ok;
+
+ sp = ap_make_sub_pool(p);
+ if ((dir = ap_popendir(sp, pathname)) == NULL) {
+ ap_destroy_pool(sp);
+ return FALSE;
+ }
+ ok = FALSE;
+ while ((nextent = readdir(dir)) != NULL) {
+ fullname = ap_pstrcat(sp, pathname, "/", nextent->d_name, NULL);
+ if (stat(fullname, &st) != 0)
+ continue;
+ if (!S_ISREG(st.st_mode))
+ continue;
+ if (SSL_load_CrtAndKeyInfo_file(sp, sk, fullname))
+ ok = TRUE;
+ }
+ ap_pclosedir(p, dir);
+ ap_destroy_pool(sp);
+ return ok;
+}
+
+#endif /* SSL_EXPERIMENTAL */
+
/* _________________________________________________________________
**
** Extra Server Certificate Chain Support
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.h b/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.h
index 43866dd461c..56674c3946a 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.h
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.h
@@ -98,6 +98,10 @@ char *SSL_make_ciphersuite(pool *, SSL *);
BOOL SSL_X509_isSGC(X509 *);
BOOL SSL_X509_getBC(X509 *, int *, int *);
BOOL SSL_X509_getCN(pool *, X509 *, char **);
+#ifdef SSL_EXPERIMENTAL
+BOOL SSL_load_CrtAndKeyInfo_file(pool *, STACK_OF(X509_INFO) *, char *);
+BOOL SSL_load_CrtAndKeyInfo_path(pool *, STACK_OF(X509_INFO) *, char *);
+#endif
int SSL_CTX_use_certificate_chain(SSL_CTX *, char *, int, int (*)());
#endif /* SSL_UTIL_SSL_H */
diff --git a/usr.sbin/httpd/src/modules/standard/mod_actions.c b/usr.sbin/httpd/src/modules/standard/mod_actions.c
index d5ab4098f1a..4b5aad2b576 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_actions.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_actions.c
@@ -195,7 +195,8 @@ static int action_handler(request_rec *r)
{
action_dir_config *conf = (action_dir_config *)
ap_get_module_config(r->per_dir_config, &action_module);
- const char *t, *action = r->handler ? r->handler : r->content_type;
+ const char *t, *action = r->handler ? r->handler :
+ ap_field_noparam(r->pool, r->content_type);
const char *script;
int i;
diff --git a/usr.sbin/httpd/src/modules/standard/mod_auth.c b/usr.sbin/httpd/src/modules/standard/mod_auth.c
index e07dc453733..bd1b4c2fc2e 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_auth.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_auth.c
@@ -110,7 +110,7 @@ static const command_rec auth_cmds[] =
{"AuthAuthoritative", ap_set_flag_slot,
(void *) XtOffsetOf(auth_config_rec, auth_authoritative),
OR_AUTHCFG, FLAG,
- "Set to 'no' to allow access control to be passed along to lower modules if the UserID is not known to this module"},
+ "Set to 'off' to allow access control to be passed along to lower modules if the UserID is not known to this module"},
{NULL}
};
diff --git a/usr.sbin/httpd/src/modules/standard/mod_auth_db.module b/usr.sbin/httpd/src/modules/standard/mod_auth_db.module
index dba647d9a29..4636763b2a7 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_auth_db.module
+++ b/usr.sbin/httpd/src/modules/standard/mod_auth_db.module
@@ -2,19 +2,19 @@ Name: db_auth_module
ConfigStart
DB_VERSION=''
DB_LIB=''
- if sh helpers/TestCompile func db_create; then
+ if ./helpers/TestCompile func db_create; then
DB_VERSION='Berkeley-DB/3.x'
- elif sh helpers/TestCompile lib db db_create; then
+ elif ./helpers/TestCompile lib db db_create; then
DB_VERSION='Berkeley-DB/3.x'
DB_LIB='-ldb'
- elif sh helpers/TestCompile func db_open; then
+ elif ./helpers/TestCompile func db_open; then
DB_VERSION='Berkeley-DB/2.x'
- elif sh helpers/TestCompile lib db db_open; then
+ elif ./helpers/TestCompile lib db db_open; then
DB_VERSION='Berkeley-DB/2.x'
DB_LIB='-ldb'
- elif sh helpers/TestCompile func dbopen; then
+ elif ./helpers/TestCompile func dbopen; then
DB_VERSION='Berkeley-DB/1.x'
- elif sh helpers/TestCompile lib db dbopen; then
+ elif ./helpers/TestCompile lib db dbopen; then
DB_VERSION='Berkeley-DB/1.x'
DB_LIB='-ldb'
fi
diff --git a/usr.sbin/httpd/src/modules/standard/mod_autoindex.c b/usr.sbin/httpd/src/modules/standard/mod_autoindex.c
index df1365b2ef4..7ca656b06c6 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_autoindex.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_autoindex.c
@@ -732,7 +732,7 @@ struct ent {
static char *find_item(request_rec *r, array_header *list, int path_only)
{
- const char *content_type = r->content_type;
+ const char *content_type = ap_field_noparam(r->pool, r->content_type);
const char *content_encoding = r->content_encoding;
char *path = r->filename;
diff --git a/usr.sbin/httpd/src/modules/standard/mod_cern_meta.c b/usr.sbin/httpd/src/modules/standard/mod_cern_meta.c
index fb7d48b675f..d8101948c72 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_cern_meta.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_cern_meta.c
@@ -169,7 +169,7 @@ module MODULE_VAR_EXPORT cern_meta_module;
typedef struct {
char *metadir;
char *metasuffix;
- char *metafiles;
+ int metafiles;
} cern_meta_dir_config;
static void *create_cern_meta_dir_config(pool *p, char *dummy)
@@ -210,7 +210,7 @@ static const char *set_metasuffix(cmd_parms *parms, cern_meta_dir_config * dconf
return NULL;
}
-static const char *set_metafiles(cmd_parms *parms, cern_meta_dir_config * dconf, char *arg)
+static const char *set_metafiles(cmd_parms *parms, cern_meta_dir_config * dconf, int arg)
{
dconf->metafiles = arg;
return NULL;
diff --git a/usr.sbin/httpd/src/modules/standard/mod_expires.c b/usr.sbin/httpd/src/modules/standard/mod_expires.c
index 73392bdd2a2..5d1bf13aebf 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_expires.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_expires.c
@@ -437,7 +437,8 @@ static int add_expires(request_rec *r)
if (r->content_type == NULL)
code = NULL;
else
- code = (char *) ap_table_get(conf->expiresbytype, r->content_type);
+ code = (char *) ap_table_get(conf->expiresbytype,
+ ap_field_noparam(r->pool, r->content_type));
if (code == NULL) {
/* no expires defined for that type, is there a default? */
diff --git a/usr.sbin/httpd/src/modules/standard/mod_include.c b/usr.sbin/httpd/src/modules/standard/mod_include.c
index dacf096fc76..65dc18823c4 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_include.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_include.c
@@ -922,6 +922,9 @@ static int handle_echo(FILE *in, request_rec *r, const char *error)
{
char tag[MAX_STRING_LEN];
char *tag_val;
+ enum {E_NONE, E_URL, E_ENTITY} encode;
+
+ encode = E_ENTITY;
while (1) {
if (!(tag_val = get_tag(r->pool, in, tag, sizeof(tag), 1))) {
@@ -931,7 +934,15 @@ static int handle_echo(FILE *in, request_rec *r, const char *error)
const char *val = ap_table_get(r->subprocess_env, tag_val);
if (val) {
- ap_rputs(val, r);
+ if (encode == E_NONE) {
+ ap_rputs(val, r);
+ }
+ else if (encode == E_URL) {
+ ap_rputs(ap_escape_uri(r->pool, val), r);
+ }
+ else if (encode == E_ENTITY) {
+ ap_rputs(ap_escape_html(r->pool, val), r);
+ }
}
else {
ap_rputs("(none)", r);
@@ -940,6 +951,19 @@ static int handle_echo(FILE *in, request_rec *r, const char *error)
else if (!strcmp(tag, "done")) {
return 0;
}
+ else if (!strcmp(tag, "encoding")) {
+ if (!strcasecmp(tag_val, "none")) encode = E_NONE;
+ else if (!strcasecmp(tag_val, "url")) encode = E_URL;
+ else if (!strcasecmp(tag_val, "entity")) encode = E_ENTITY;
+ else {
+ ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
+ "unknown value \"%s\" to parameter \"encoding\" of "
+ "tag echo in %s",
+ tag_val, r->filename);
+ ap_rputs(error, r);
+ }
+ }
+
else {
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
"unknown parameter \"%s\" to tag echo in %s",
@@ -2116,7 +2140,8 @@ static int handle_printenv(FILE *in, request_rec *r, const char *error)
}
else if (!strcmp(tag, "done")) {
for (i = 0; i < arr->nelts; ++i) {
- ap_rvputs(r, elts[i].key, "=", elts[i].val, "\n", NULL);
+ ap_rvputs(r, ap_escape_html(r->pool, elts[i].key), "=",
+ ap_escape_html(r->pool, elts[i].val), "\n", NULL);
}
return 0;
}
diff --git a/usr.sbin/httpd/src/modules/standard/mod_log_config.c b/usr.sbin/httpd/src/modules/standard/mod_log_config.c
index 78af1c8b968..e92d78b9bb0 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_log_config.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_log_config.c
@@ -394,7 +394,7 @@ static const char *log_header_out(request_rec *r, char *a)
{
const char *cp = ap_table_get(r->headers_out, a);
if (!strcasecmp(a, "Content-type") && r->content_type) {
- cp = r->content_type;
+ cp = ap_field_noparam(r->pool, r->content_type);
}
if (cp) {
return cp;
diff --git a/usr.sbin/httpd/src/modules/standard/mod_mime.c b/usr.sbin/httpd/src/modules/standard/mod_mime.c
index 134196f1d9e..8b27d141e90 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_mime.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_mime.c
@@ -345,7 +345,7 @@ static int is_token(char c)
{
int res;
- res = (ap_isascii(c) && isgraph(c)
+ res = (ap_isascii(c) && ap_isgraph(c)
&& (strchr(tspecial, c) == NULL)) ? 1 : -1;
return res;
}
diff --git a/usr.sbin/httpd/src/modules/standard/mod_speling.c b/usr.sbin/httpd/src/modules/standard/mod_speling.c
index 328ec9937af..1e3a1b34ff2 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_speling.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_speling.c
@@ -455,7 +455,7 @@ static int check_speling(request_rec *r)
*(const char **)ap_push_array(t) =
"The document name you requested (";
- *(const char **)ap_push_array(t) = r->uri;
+ *(const char **)ap_push_array(t) = ap_escape_html(sub_pool, r->uri);
*(const char **)ap_push_array(t) =
" ) could not be found on this server.\n"
"However, we found documents with names similar "
@@ -474,15 +474,15 @@ static int check_speling(request_rec *r)
? r->parsed_uri.query : "",
NULL);
*(const char **)ap_push_array(v) = "\"";
- *(const char **)ap_push_array(v) = vuri;
+ *(const char **)ap_push_array(v) = ap_escape_uri(sub_pool, vuri);
*(const char **)ap_push_array(v) = "\";\"";
*(const char **)ap_push_array(v) = reason;
*(const char **)ap_push_array(v) = "\"";
*(const char **)ap_push_array(t) = "- ";
- *(const char **)ap_push_array(t) = vuri;
+ *(const char **)ap_push_array(t) = ap_escape_html(sub_pool, vuri);
*(const char **)ap_push_array(t) = " (";
*(const char **)ap_push_array(t) = reason;
*(const char **)ap_push_array(t) = ")\n";
@@ -509,7 +509,7 @@ static int check_speling(request_rec *r)
*(const char **)ap_push_array(t) =
"Please consider informing the owner of the "
"referring page "
"about the broken link.\n";
}
diff --git a/usr.sbin/httpd/src/modules/standard/mod_status.c b/usr.sbin/httpd/src/modules/standard/mod_status.c
index fba55c982f5..c6786a212ab 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_status.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_status.c
@@ -135,24 +135,19 @@ module MODULE_VAR_EXPORT status_module;
*command-related code. This is here to prevent use of ExtendedStatus
* without status_module included.
*/
-static const char *set_extended_status(cmd_parms *cmd, void *dummy, char *arg)
+static const char *set_extended_status(cmd_parms *cmd, void *dummy, int arg)
{
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
if (err != NULL) {
return err;
}
- if (!strcasecmp(arg, "off") || !strcmp(arg, "0")) {
- ap_extended_status = 0;
- }
- else {
- ap_extended_status = 1;
- }
+ ap_extended_status = arg;
return NULL;
}
static const command_rec status_module_cmds[] =
{
- { "ExtendedStatus", set_extended_status, NULL, RSRC_CONF, TAKE1,
+ { "ExtendedStatus", set_extended_status, NULL, RSRC_CONF, FLAG,
"\"On\" to enable extended status information, \"Off\" to disable" },
{NULL}
};
@@ -618,9 +613,10 @@ static int status_handler(request_rec *r)
format_byte_out(r, bytes);
ap_rputs(")\n", r);
ap_rprintf(r, " %s {%s} [%s]
\n\n",
- score_record.client,
+ ap_escape_html(r->pool, score_record.client),
ap_escape_html(r->pool, score_record.request),
- vhost ? vhost->server_hostname : "(unavailable)");
+ vhost ? ap_escape_html(r->pool,
+ vhost->server_hostname) : "(unavailable)");
}
else { /* !no_table_report */
#ifndef NO_PRETTYPRINT
@@ -707,8 +703,9 @@ static int status_handler(request_rec *r)
#else
ap_rprintf(r,
"%s | %s | %s | \n\n",
- score_record.client,
- vhost ? vhost->server_hostname : "(unavailable)",
+ ap_escape_html(r->pool, score_record.client),
+ vhost ? ap_escape_html(r->pool,
+ vhost->server_hostname) : "(unavailable)",
ap_escape_html(r->pool, score_record.request));
#endif
} /* no_table_report */
diff --git a/usr.sbin/httpd/src/os/bs2000/ebcdic.h b/usr.sbin/httpd/src/os/bs2000/ebcdic.h
index 9712cfaf00f..3549b26901b 100644
--- a/usr.sbin/httpd/src/os/bs2000/ebcdic.h
+++ b/usr.sbin/httpd/src/os/bs2000/ebcdic.h
@@ -1,5 +1,5 @@
#ifndef AP_EBCDIC_H
-#define AP_EBCDIC_H "$Id: ebcdic.h,v 1.2 2000/01/25 18:30:05 beck Exp $"
+#define AP_EBCDIC_H "$Id: ebcdic.h,v 1.3 2000/03/19 11:17:32 beck Exp $"
#include
diff --git a/usr.sbin/httpd/src/os/win32/registry.c b/usr.sbin/httpd/src/os/win32/registry.c
index 025a5f1a7c1..cb4e4a49518 100644
--- a/usr.sbin/httpd/src/os/win32/registry.c
+++ b/usr.sbin/httpd/src/os/win32/registry.c
@@ -38,7 +38,7 @@
#define VENDOR "Apache Group"
#define SOFTWARE "Apache"
-#define VERSION "1.3.11"
+#define VERSION "1.3.12"
#define REGKEY "SOFTWARE\\" VENDOR "\\" SOFTWARE "\\" VERSION
diff --git a/usr.sbin/httpd/src/support/ab.c b/usr.sbin/httpd/src/support/ab.c
index e1abd8dae91..9135a261378 100644
--- a/usr.sbin/httpd/src/support/ab.c
+++ b/usr.sbin/httpd/src/support/ab.c
@@ -81,7 +81,7 @@
** - Cleaned up by Ralf S. Engelschall , March 1998
** - POST and verbosity by Kurt Sussman , August 1998
** - HTML table output added by David N. Welton , January 1999
- ** - Added Cookie, Arbitrary header and auth support. , April 199
+ ** - Added Cookie, Arbitrary header and auth support. , April 1999
**
*/
@@ -884,14 +884,14 @@ static void test(void)
static void copyright(void)
{
if (!use_html) {
- printf("This is ApacheBench, Version %s\n", VERSION " <$Revision: 1.4 $> apache-1.3");
+ printf("This is ApacheBench, Version %s\n", VERSION " <$Revision: 1.5 $> apache-1.3");
printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
printf("Copyright (c) 1998-1999 The Apache Group, http://www.apache.org/\n");
printf("\n");
}
else {
printf("\n");
- printf(" This is ApacheBench, Version %s <%s> apache-1.3 \n", VERSION, "$Revision: 1.4 $");
+ printf(" This is ApacheBench, Version %s <%s> apache-1.3 \n", VERSION, "$Revision: 1.5 $");
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ \n");
printf(" Copyright (c) 1998-1999 The Apache Group, http://www.apache.org/ \n");
printf(" \n\n");
diff --git a/usr.sbin/httpd/src/support/apxs.pl b/usr.sbin/httpd/src/support/apxs.pl
index a39b9fd15bf..674fd1bce9c 100644
--- a/usr.sbin/httpd/src/support/apxs.pl
+++ b/usr.sbin/httpd/src/support/apxs.pl
@@ -297,7 +297,7 @@ if ($opt_q) {
)) {
if ($arg eq $name or $arg eq lc($name)) {
my $val = eval "\$CFG_$name";
- $result .= "${val}::";
+ $result .= "${val}##";
$ok = 1;
}
}
@@ -306,8 +306,8 @@ if ($opt_q) {
exit(1);
}
}
- $result =~ s|::$||;
- $result =~ s|::| |;
+ $result =~ s|##$||;
+ $result =~ s|##| |g;
print $result;
}
diff --git a/usr.sbin/httpd/src/support/htdigest.c b/usr.sbin/httpd/src/support/htdigest.c
index 6d42bbd4134..cb98a1147d2 100644
--- a/usr.sbin/httpd/src/support/htdigest.c
+++ b/usr.sbin/httpd/src/support/htdigest.c
@@ -72,7 +72,7 @@
#endif
#include "ap.h"
#include "ap_md5.h"
-#if defined(MPE) || defined(QNX) || defined(WIN32) || defined(__TANDEM) || defined(OS390)
+#if defined(MPE) || defined(QNX) || defined(WIN32) || defined(__TANDEM) || defined(OS390) || defined(BEOS)
#include
#else
#include
diff --git a/usr.sbin/httpd/src/support/htpasswd.1 b/usr.sbin/httpd/src/support/htpasswd.1
index 1687cde41c2..58b6b338c1e 100644
--- a/usr.sbin/httpd/src/support/htpasswd.1
+++ b/usr.sbin/httpd/src/support/htpasswd.1
@@ -1,5 +1,5 @@
-.TH htpasswd 1 "February 1997"
-.\" Copyright (c) 1997-1999 The Apache Group. All rights reserved.
+.TH htpasswd 1 "February 2000"
+.\" Copyright (c) 1997-2000 The Apache Group. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -61,6 +61,12 @@ htpasswd \- Create and update user authentication files
]
[
.B \-m
+|
+.B \-d
+|
+.B \-s
+|
+.B \-p
]
.I passwdfile
.I username
@@ -72,9 +78,12 @@ htpasswd \- Create and update user authentication files
]
[
.B \-m
+|
.B \-d
-.B \-p
+|
.B \-s
+|
+.B \-p
]
.I passwdfile
.I username
@@ -123,7 +132,10 @@ line.\fP
Create the \fIpasswdfile\fP. If \fIpasswdfile\fP already exists, it
is rewritten and truncated.
.IP \-m
-Use MD5 encryption for passwords. On Windows and TPF, this is the default.
+Use Apache's modified MD5 algorithm for passwords. Passwords encrypted
+with this algorithm are transportable to any platform (Windows, Unix,
+BeOS, et cetera) running Apache 1.3.9 or later. On Windows and TPF,
+this flag is the default.
.IP \-d
Use crypt() encryption for passwords. The default on all platforms but
Windows and TPF. Though possibly supported by
@@ -137,7 +149,7 @@ servers using the LDAP Directory Interchange Format (ldif).
.IP \-p
Use plaintext passwords. Though
.B htpasswd
-will support creation on all platofrms, the
+will support creation on all platforms, the
.B httpd
deamon will only accept plain text passwords on Windows and TPF.
.IP \fB\fIpasswdfile\fP
diff --git a/usr.sbin/httpd/src/support/logresolve.c b/usr.sbin/httpd/src/support/logresolve.c
index 6b4ae6bc277..2e02e3a80f0 100644
--- a/usr.sbin/httpd/src/support/logresolve.c
+++ b/usr.sbin/httpd/src/support/logresolve.c
@@ -45,8 +45,14 @@
#include
#ifndef MPE
+#ifndef BEOS
#include
-#endif
+#else
+/* BeOS lacks the necessary files until we get the new networking */
+#include
+#define NO_ADDRESS 4
+#endif /* BEOS */
+#endif /* MPE */
static void cgethost(struct in_addr ipnum, char *string, int check);
static int getline(char *s, int n);
diff --git a/usr.sbin/httpd/src/support/mkcert.sh b/usr.sbin/httpd/src/support/mkcert.sh
index 5c5ca5d9053..46e44eea6c0 100644
--- a/usr.sbin/httpd/src/support/mkcert.sh
+++ b/usr.sbin/httpd/src/support/mkcert.sh
@@ -1,6 +1,6 @@
#!/bin/sh
##
-## mkcert.sh -- Make SSL Certificate Files for `make certificate' command
+## mkcert.sh -- SSL Certificate Generation Utility
## Copyright (c) 1998-2000 Ralf S. Engelschall, All Rights Reserved.
##
@@ -96,9 +96,8 @@ fi
# (do not use /dev/random here, because this device
# doesn't work as expected on all platforms)
randfiles=''
-for file in /var/log/messages /var/adm/messages \
- /kernel /vmunix /vmlinuz \
- /etc/hosts /etc/resolv.conf; do
+for file in /var/log/messages /var/adm/messages /var/log/system.log \
+ /kernel /vmunix /vmlinuz /mach /etc/hosts /etc/resolv.conf; do
if [ -f $file ]; then
if [ ".$randfiles" = . ]; then
randfiles="$file"
@@ -108,6 +107,15 @@ for file in /var/log/messages /var/adm/messages \
fi
done
+# initialize random file
+if [ -f $HOME/.rnd ]; then
+ RANDFILE="$HOME/.rnd"
+else
+ RANDFILE=".mkcert.rnd"
+ touch $RANDFILE
+fi
+export RANDFILE
+
# canonicalize parameters
case "x$type" in
x ) type=test ;;
@@ -140,12 +148,11 @@ case $type in
fi
if [ ".$algo" = .RSA ]; then
cp $sslcrtdir/snakeoil-rsa.crt $sslcrtdir/server.crt
- cp $sslkeydir/snakeoil-rsa.key $sslkeydir/server.key
+ (umask 077; cp $sslkeydir/snakeoil-rsa.key $sslkeydir/server.key)
else
cp $sslcrtdir/snakeoil-dsa.crt $sslcrtdir/server.crt
- cp $sslkeydir/snakeoil-dsa.key $sslkeydir/server.key
+ (umask 077; cp $sslkeydir/snakeoil-dsa.key $sslkeydir/server.key)
fi
- chmod 600 $sslkeydir/server.key
echo "${T_MD}RESULT: Server Certification Files${T_ME}"
echo ""
echo "o ${T_MD}conf/ssl.key/server.key${T_ME}"
@@ -203,9 +210,6 @@ case $type in
echo "______________________________________________________________________"
echo ""
echo "${T_MD}STEP 1: Generating $algo private key (1024 bit) [server.key]${T_ME}"
- if [ ! -f $HOME/.rnd ]; then
- touch $HOME/.rnd
- fi
if [ ".$algo" = .RSA ]; then
if [ ".$randfiles" != . ]; then
$openssl genrsa -rand $randfiles -out $sslkeydir/server.key 1024
@@ -219,16 +223,20 @@ case $type in
else
echo "Generating DSA private key via SnakeOil CA DSA parameters"
if [ ".$randfiles" != . ]; then
- $openssl gendsa -rand $randfiles -out $sslkeydir/server.key $sslprmdir/snakeoil-ca-dsa.prm
+ (umask 077
+ $openssl gendsa -rand $randfiles \
+ -out $sslkeydir/server.key \
+ $sslprmdir/snakeoil-ca-dsa.prm)
else
- $openssl gendsa -out $sslkeydir/server.key $sslprmdir/snakeoil-ca-dsa.prm
+ (umask 077
+ $openssl gendsa -out $sslkeydir/server.key \
+ $sslprmdir/snakeoil-ca-dsa.prm)
fi
if [ $? -ne 0 ]; then
echo "mkcert.sh:Error: Failed to generate DSA private key" 1>&2
exit 1
fi
fi
- chmod 600 $sslkeydir/server.key
echo "______________________________________________________________________"
echo ""
echo "${T_MD}STEP 2: Generating X.509 certificate signing request [server.csr]${T_ME}"
@@ -353,21 +361,22 @@ EOT
done
if [ ".$rc" = .y ]; then
if [ ".$algo" = .RSA ]; then
- $openssl rsa -des3 \
- -in $sslkeydir/server.key \
- -out $sslkeydir/server.key.crypt
+ (umask 077
+ $openssl rsa -des3 \
+ -in $sslkeydir/server.key \
+ -out $sslkeydir/server.key.crypt)
else
- $openssl dsa -des3 \
- -in $sslkeydir/server.key \
- -out $sslkeydir/server.key.crypt
+ (umask 077
+ $openssl dsa -des3 \
+ -in $sslkeydir/server.key \
+ -out $sslkeydir/server.key.crypt)
fi
if [ $? -ne 0 ]; then
echo "mkcert.sh:Error: Failed to encrypt $algo private key" 1>&2
exit 1
fi
- cp $sslkeydir/server.key.crypt $sslkeydir/server.key
+ (umask 077; cp $sslkeydir/server.key.crypt $sslkeydir/server.key)
rm -f $sslkeydir/server.key.crypt
- chmod 600 $sslkeydir/server.key
echo "Fine, you're using an encrypted $algo private key."
else
echo "Warning, you're using an unencrypted $algo private key."
@@ -438,9 +447,6 @@ EOT
echo "______________________________________________________________________"
echo ""
echo "${T_MD}STEP 1: Generating $algo private key for CA (1024 bit) [ca.key]${T_ME}"
- if [ ! -f $HOME/.rnd ]; then
- touch $HOME/.rnd
- fi
if [ ".$algo" = .RSA ]; then
if [ ".$randfiles" != . ]; then
$openssl genrsa -rand $randfiles -out $sslkeydir/ca.key 1024
@@ -455,18 +461,19 @@ EOT
if [ ".$randfiles" != . ]; then
$openssl dsaparam -rand $randfiles -out $sslprmdir/ca.prm 1024
echo "Generating DSA private key:"
- $openssl gendsa -rand $randfiles -out $sslkeydir/ca.key $sslprmdir/ca.prm
+ (umask 077
+ $openssl gendsa -rand $randfiles -out $sslkeydir/ca.key $sslprmdir/ca.prm)
else
$openssl dsaparam -out $sslprmdir/ca.prm 1024
echo "Generating DSA private key:"
- $openssl gendsa -out $sslkeydir/ca.key $sslprmdir/ca.prm
+ (umask 077
+ $openssl gendsa -out $sslkeydir/ca.key $sslprmdir/ca.prm)
fi
if [ $? -ne 0 ]; then
echo "mkcert.sh:Error: Failed to generate DSA private key" 1>&2
exit 1
fi
fi
- chmod 600 $sslkeydir/ca.key
echo "______________________________________________________________________"
echo ""
echo "${T_MD}STEP 2: Generating X.509 certificate signing request for CA [ca.csr]${T_ME}"
@@ -556,9 +563,6 @@ EOT
echo "______________________________________________________________________"
echo ""
echo "${T_MD}STEP 4: Generating $algo private key for SERVER (1024 bit) [server.key]${T_ME}"
- if [ ! -f $HOME/.rnd ]; then
- touch $HOME/.rnd
- fi
if [ ".$algo" = .RSA ]; then
if [ ".$randfiles" != . ]; then
$openssl genrsa -rand $randfiles -out $sslkeydir/server.key 1024
@@ -571,16 +575,18 @@ EOT
fi
else
if [ ".$randfiles" != . ]; then
- $openssl gendsa -rand $randfiles -out $sslkeydir/server.key $sslprmdir/ca.prm
+ (umask 077
+ $openssl gendsa -rand $randfiles \
+ -out $sslkeydir/server.key $sslprmdir/ca.prm)
else
- $openssl gendsa -out $sslkeydir/server.key $sslprmdir/ca.prm
+ (umask 077
+ $openssl gendsa -out $sslkeydir/server.key $sslprmdir/ca.prm)
fi
if [ $? -ne 0 ]; then
echo "mkcert.sh:Error: Failed to generate DSA private key" 1>&2
exit 1
fi
fi
- chmod 600 $sslkeydir/server.key
echo "______________________________________________________________________"
echo ""
echo "${T_MD}STEP 5: Generating X.509 certificate signing request for SERVER [server.csr]${T_ME}"
@@ -691,21 +697,22 @@ EOT
done
if [ ".$rc" = .y ]; then
if [ ".$algo" = .RSA ]; then
- $openssl rsa -des3 \
- -in $sslkeydir/ca.key \
- -out $sslkeydir/ca.key.crypt
+ (umask 077
+ $openssl rsa -des3 \
+ -in $sslkeydir/ca.key \
+ -out $sslkeydir/ca.key.crypt)
else
- $openssl dsa -des3 \
- -in $sslkeydir/ca.key \
- -out $sslkeydir/ca.key.crypt
+ (umask 077
+ $openssl dsa -des3 \
+ -in $sslkeydir/ca.key \
+ -out $sslkeydir/ca.key.crypt)
fi
if [ $? -ne 0 ]; then
echo "mkcert.sh:Error: Failed to encrypt $algo private key" 1>&2
exit 1
fi
- cp $sslkeydir/ca.key.crypt $sslkeydir/ca.key
+ (umask 077; cp $sslkeydir/ca.key.crypt $sslkeydir/ca.key)
rm -f $sslkeydir/ca.key.crypt
- chmod 600 $sslkeydir/ca.key
echo "Fine, you're using an encrypted private key."
else
echo "Warning, you're using an unencrypted private key."
@@ -731,21 +738,22 @@ EOT
done
if [ ".$rc" = .y ]; then
if [ ".$algo" = .RSA ]; then
- $openssl rsa -des3 \
- -in $sslkeydir/server.key \
- -out $sslkeydir/server.key.crypt
+ (umask 077
+ $openssl rsa -des3 \
+ -in $sslkeydir/server.key \
+ -out $sslkeydir/server.key.crypt)
else
- $openssl dsa -des3 \
- -in $sslkeydir/server.key \
- -out $sslkeydir/server.key.crypt
+ (umask 077
+ $openssl dsa -des3 \
+ -in $sslkeydir/server.key \
+ -out $sslkeydir/server.key.crypt)
fi
if [ $? -ne 0 ]; then
echo "mkcert.sh:Error: Failed to encrypt $algo private key" 1>&2
exit 1
fi
- cp $sslkeydir/server.key.crypt $sslkeydir/server.key
+ (umask 077; cp $sslkeydir/server.key.crypt $sslkeydir/server.key)
rm -f $sslkeydir/server.key.crypt
- chmod 600 $sslkeydir/server.key
echo "Fine, you're using an encrypted $algo private key."
else
echo "Warning, you're using an unencrypted $algo private key."
@@ -805,15 +813,16 @@ EOT
exit 1
fi
cp $crt $sslcrtdir/server.crt
- cp $key $sslkeydir/server.key
+ (umask 077; cp $key $sslkeydir/server.key)
else
key=$crt
+ umask 077
+ touch $sslkeydir/server.key
sed -e '/-----BEGIN CERTIFICATE/,/-----END CERTIFICATE/p' -e '/.*/d' \
<$crt >$sslcrtdir/server.crt
sed -e '/-----BEGIN ... PRIVATE KEY/,/-----END ... PRIVATE KEY/p' -e '/.*/d' \
<$key >$sslkeydir/server.key
fi
- chmod 600 $sslkeydir/server.key
$openssl x509 -noout -in $sslcrtdir/server.crt
if [ $? -ne 0 ]; then
echo "mkcert.sh:Error: Failed to check certificate contents: $crt" 1>&2
| | | | | | | | |
|
|
|
|