diff options
author | wbx <wbx@hydrogenium.(none)> | 2009-05-17 14:41:34 +0200 |
---|---|---|
committer | wbx <wbx@hydrogenium.(none)> | 2009-05-17 14:41:34 +0200 |
commit | 219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch) | |
tree | b9c0f3c43aebba2fcfef777592d0add39f2072f4 /package/mini_httpd |
Initial import
Diffstat (limited to 'package/mini_httpd')
18 files changed, 402 insertions, 0 deletions
diff --git a/package/mini_httpd/Config.in b/package/mini_httpd/Config.in new file mode 100644 index 000000000..3922f14cd --- /dev/null +++ b/package/mini_httpd/Config.in @@ -0,0 +1,66 @@ +config ADK_COMPILE_MINI_HTTPD + tristate + default n + depends ADK_PACKAGE_MINI_HTTPD || ADK_PACKAGE_MINI_HTTPD_OPENSSL + +config ADK_PACKAGE_MINI_HTTPD + prompt "mini-httpd........................ A small web server" + tristate + default n + select ADK_COMPILE_MINI_HTTPD + help + mini_httpd is a small HTTP server. Its performance is not great, but for + low or medium traffic sites it's quite adequate. It implements all the + basic features of an HTTP server, including: + + * GET, HEAD, and POST methods. + * CGI. + * Basic authentication. + * Security against ".." filename snooping. + * The common MIME types. + * Trailing-slash redirection. + * index.html, index.htm, index.cgi + * Directory listings. + * Multihoming / virtual hosting. + * Standard logging. + * Custom error pages. + + It can also be configured to do IPv6. + + http://www.acme.com/software/mini_httpd/ + +config ADK_PACKAGE_MINI_HTTPD_HTPASSWD + prompt "mini-httpd-htpasswd............... Utility to generate HTTP access files" + tristate + default n + select ADK_PACKAGE_MINI_HTTPD + help + This file generates .htaccess/.htpasswd files to use HTTP access authentication + + +config ADK_PACKAGE_MINI_HTTPD_OPENSSL + prompt "mini-httpd-openssl................ A small web server, built with SSL support using OpenSSL" + tristate + default n + select ADK_COMPILE_MINI_HTTPD + select ADK_PACKAGE_LIBOPENSSL + help + mini_httpd is a small HTTP server. Its performance is not great, but for + low or medium traffic sites it's quite adequate. It implements all the + basic features of an HTTP server, including: + + * GET, HEAD, and POST methods. + * CGI. + * Basic authentication. + * Security against ".." filename snooping. + * The common MIME types. + * Trailing-slash redirection. + * index.html, index.htm, index.cgi + * Directory listings. + * Multihoming / virtual hosting. + * Standard logging. + * Custom error pages. + + It can also be configured to do SSL/HTTPS and IPv6. + + http://www.acme.com/software/mini_httpd/ diff --git a/package/mini_httpd/Makefile b/package/mini_httpd/Makefile new file mode 100644 index 000000000..5799b39f4 --- /dev/null +++ b/package/mini_httpd/Makefile @@ -0,0 +1,63 @@ +# $Id$ +#- +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include ${TOPDIR}/rules.mk + +PKG_NAME:= mini-httpd +PKG_VERSION:= 1.19 +PKG_RELEASE:= 10 +PKG_MD5SUM:= 7c68293ad265ecfe2edea917912f6f1f +MASTER_SITES:= http://www.acme.com/software/mini_httpd/ +DISTFILES:= mini_httpd-${PKG_VERSION}.tar.gz +WRKDIST= ${WRKDIR}/mini_httpd-${PKG_VERSION} + +include ${TOPDIR}/mk/package.mk + +$(eval $(call PKG_template,MINI_HTTPD,mini-httpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH})) +$(eval $(call PKG_template,MINI_HTTPD_HTPASSWD,mini-httpd-htpasswd,${PKG_VERSION}-${PKG_RELEASE},${ARCH})) +$(eval $(call PKG_template,MINI_HTTPD_OPENSSL,mini-httpd-openssl,${PKG_VERSION}-${PKG_RELEASE},${ARCH})) + +do-build: + # with OpenSSL +ifneq (${ADK_PACKAGE_MINI_HTTPD_OPENSSL},) + ${MAKE} -C ${WRKBUILD} \ + CC="${TARGET_CC}" \ + SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \ + SSL_INC="-I${STAGING_DIR}/usr/include" \ + SSL_LIBS="-L${STAGING_DIR}/usr/lib -lssl -lcrypto" \ + all + (cd ${WRKBUILD}; mv mini_httpd mini_httpd-openssl; ) + ${MAKE} -C ${WRKBUILD} clean +endif + # without SSL +ifneq (${ADK_PACKAGE_MINI_HTTPD},) + ${MAKE} -C ${WRKBUILD} \ + CC="${TARGET_CC}" \ + all +endif + +do-install: + # without SSL +ifneq (${ADK_PACKAGE_MINI_HTTPD},) + ${INSTALL_DIR} ${IDIR_MINI_HTTPD}/etc/init.d + ${INSTALL_DATA} ./files/mini_httpd.conf ${IDIR_MINI_HTTPD}/etc/mini_httpd.conf + ${INSTALL_BIN} ./files/mini_httpd.init ${IDIR_MINI_HTTPD}/etc/init.d/mini_httpd + ${INSTALL_DIR} ${IDIR_MINI_HTTPD}/usr/sbin + ${INSTALL_BIN} ${WRKBUILD}/mini_httpd ${IDIR_MINI_HTTPD}/usr/sbin/ + ${INSTALL_DIR} ${IDIR_MINI_HTTPD_HTPASSWD}/usr/sbin + install -m0755 ${WRKBUILD}/htpasswd ${IDIR_MINI_HTTPD_HTPASSWD}/usr/sbin/ +endif + # with OpenSSL +ifneq (${ADK_PACKAGE_MINI_HTTPD_OPENSSL},) + ${INSTALL_DIR} ${IDIR_MINI_HTTPD_OPENSSL}/etc/init.d + ${INSTALL_DATA} ./files/mini_httpd-ssl.conf ${IDIR_MINI_HTTPD_OPENSSL}/etc/mini_httpd.conf + install -m0600 ./files/mini_httpd.pem ${IDIR_MINI_HTTPD_OPENSSL}/etc/ + ${INSTALL_BIN} ./files/mini_httpd.init \ + ${IDIR_MINI_HTTPD_OPENSSL}/etc/init.d/mini_httpd + ${INSTALL_DIR} ${IDIR_MINI_HTTPD_OPENSSL}/usr/sbin + ${INSTALL_BIN} ${WRKBUILD}/mini_httpd-openssl ${IDIR_MINI_HTTPD_OPENSSL}/usr/sbin/mini_httpd +endif + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/mini_httpd/files/mini_httpd-ssl.conf b/package/mini_httpd/files/mini_httpd-ssl.conf new file mode 100644 index 000000000..5b616f6e5 --- /dev/null +++ b/package/mini_httpd/files/mini_httpd-ssl.conf @@ -0,0 +1,7 @@ +cgipat=cgi-bin/**|**.sh|**.cgi|**.pl +dir=/www +nochroot +pidfile=/var/run/mini_httpd.pid +user=root +ssl +certfile=/etc/mini_httpd.pem diff --git a/package/mini_httpd/files/mini_httpd.conf b/package/mini_httpd/files/mini_httpd.conf new file mode 100644 index 000000000..c075f7d80 --- /dev/null +++ b/package/mini_httpd/files/mini_httpd.conf @@ -0,0 +1,5 @@ +cgipat=cgi-bin/**|**.sh|**.cgi|**.pl +dir=/www +nochroot +pidfile=/var/run/mini_httpd.pid +user=root diff --git a/package/mini_httpd/files/mini_httpd.init b/package/mini_httpd/files/mini_httpd.init new file mode 100644 index 000000000..10479a22d --- /dev/null +++ b/package/mini_httpd/files/mini_httpd.init @@ -0,0 +1,25 @@ +#!/bin/sh +#FWINIT 60 +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + [[ $mini_httpd_flags = NO ]] && exit 0 + exec sh $0 start + ;; +start) + mini_httpd $mini_httpd_flags + ;; +stop) + killall mini_httpd + ;; +restart) + sh $0 stop + sh $0 start + ;; +*) + echo "usage: $0 {start | stop | restart}" + exit 1 +esac +exit $? diff --git a/package/mini_httpd/files/mini_httpd.pem b/package/mini_httpd/files/mini_httpd.pem new file mode 100644 index 000000000..8a1241a76 --- /dev/null +++ b/package/mini_httpd/files/mini_httpd.pem @@ -0,0 +1,29 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQC5rFJOQakwMmF9aoVnAXaQLOOPoYOEk19/ls9VZt1ZqfzQuTbG +GGrgMIDclB0kHMFvSbzeiVjMnrSdQTNe1gOQAGtHhHiqugrLqH9m3wqOerbf/Yir +hic9U6X9RaWC6BzNgcYU1QtPn1sDtbMNFAB6jzF3W76EIlHEobgMtfqtxwIDAQAB +AoGBAKJst9eToyDxgc1ICQlSA1kem7eDUF0C2xDvadLI2KxegzZIQD1NEPmsFJ5h +x5hWu3TSabG3LwJZd6D1b63vxE6QRMhcDG3idb7kXzhOOZyfnlnrBtJ3VJC/UH5H +O1pMMBxcu2fXrua+h7BW0gMoZhchvsArDoWaZPjNUNHiNRYBAkEA3Ngnge7njqlf +/UlLkQHHfxgorQ78GjOzrrUvz86pFtW8RKCjAv55HIqAhWrSgxWF4yXkPO2XOHC9 +KTeVKccjAQJBANc63r3M3yP817cPzyo/8BJQD9nAzmolrsBf1YMxML20UmEbObax +QdmxoYu/a8tOD4gT6EZDkauJU0yS69HGeMcCQQCvRmbkuuXQ1iC29+sfpVfeSSBP +aaswaIRdTrQprA2LcAtCNHPsNmeM/WfPe96j5vsiMrqYmMECLIgVJGYgiEoBAkEA +kzg1e+ZTC667bwBlWCT79crFzNDRYFH+QqBKz74p9NkPMFULGSgOPvX95jU9aocu +oInda5J0Zb09OTeWDpuPqQJAUIeY36WUst7NaW40mZXkMjjR2QtWi7P4cmv7nLp0 +WdPQzkUW1Bv4sSUQ7svQqpmZPaFiyhXL1VSa1M5MPd3tbA== +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICOTCCAaKgAwIBAgIJANRuTbnzy8ObMA0GCSqGSIb3DQEBBAUAMFMxCzAJBgNV +BAYTAkZSMQ4wDAYDVQQIEwVQYXJpczEOMAwGA1UEBxMFUGFyaXMxEDAOBgNVBAoT +B015IEhvbWUxEjAQBgNVBAMTCU15IFJvdXRlcjAeFw0wNTAxMTQwMjQzMjdaFw0w +NjAxMTQwMjQzMjdaMFMxCzAJBgNVBAYTAkZSMQ4wDAYDVQQIEwVQYXJpczEOMAwG +A1UEBxMFUGFyaXMxEDAOBgNVBAoTB015IEhvbWUxEjAQBgNVBAMTCU15IFJvdXRl +cjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuaxSTkGpMDJhfWqFZwF2kCzj +j6GDhJNff5bPVWbdWan80Lk2xhhq4DCA3JQdJBzBb0m83olYzJ60nUEzXtYDkABr +R4R4qroKy6h/Zt8Kjnq23/2Iq4YnPVOl/UWlgugczYHGFNULT59bA7WzDRQAeo8x +d1u+hCJRxKG4DLX6rccCAwEAAaMVMBMwEQYJYIZIAYb4QgEBBAQDAgZAMA0GCSqG +SIb3DQEBBAUAA4GBAErI3QmcZVzjxKcoPTO3z8cRJV87SVFp0qbIjbYCBDUWB1QY +/bMkQPr2zJyfJmUYLEs4iKgHrmlaUCMHy9NZKOg9ZxrW42BtQ5QnOtDm3UifwzJW +oCFC3uPWfTYsZn/FrUXlErds+xXXT63VJzBe6DdXwHcdcdxzl05oIyL9JIzI +-----END CERTIFICATE----- diff --git a/package/mini_httpd/ipkg/mini-httpd-htpasswd.control b/package/mini_httpd/ipkg/mini-httpd-htpasswd.control new file mode 100644 index 000000000..6b80aa6d9 --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd-htpasswd.control @@ -0,0 +1,4 @@ +Package: mini-httpd-htpasswd +Priority: optional +Section: net +Description: utility to generate HTTP access authentication files diff --git a/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles b/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles new file mode 100644 index 000000000..38239e4e3 --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles @@ -0,0 +1,2 @@ +/etc/mini_httpd.conf +/etc/mini_httpd.pem diff --git a/package/mini_httpd/ipkg/mini-httpd-matrixssl.control b/package/mini_httpd/ipkg/mini-httpd-matrixssl.control new file mode 100644 index 000000000..5967ac7fb --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd-matrixssl.control @@ -0,0 +1,5 @@ +Package: mini-httpd-matrixssl +Priority: optional +Section: net +Description: A small HTTP server, built with SSL support using MatrixSSL. +Depends: libmatrixssl diff --git a/package/mini_httpd/ipkg/mini-httpd-matrixssl.postinst b/package/mini_httpd/ipkg/mini-httpd-matrixssl.postinst new file mode 100644 index 000000000..dfcafaa9e --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd-matrixssl.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf '"NO" to disable, "-C /etc/mini_httpd.conf" otherwise' mini_httpd_flags diff --git a/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles b/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles new file mode 100644 index 000000000..38239e4e3 --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles @@ -0,0 +1,2 @@ +/etc/mini_httpd.conf +/etc/mini_httpd.pem diff --git a/package/mini_httpd/ipkg/mini-httpd-openssl.control b/package/mini_httpd/ipkg/mini-httpd-openssl.control new file mode 100644 index 000000000..09bfb6682 --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd-openssl.control @@ -0,0 +1,5 @@ +Package: mini-httpd-openssl +Priority: optional +Section: net +Description: A small HTTP server, built with SSL support using OpenSSL. +Depends: libopenssl diff --git a/package/mini_httpd/ipkg/mini-httpd-openssl.postinst b/package/mini_httpd/ipkg/mini-httpd-openssl.postinst new file mode 100644 index 000000000..dfcafaa9e --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd-openssl.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf '"NO" to disable, "-C /etc/mini_httpd.conf" otherwise' mini_httpd_flags diff --git a/package/mini_httpd/ipkg/mini-httpd.conffiles b/package/mini_httpd/ipkg/mini-httpd.conffiles new file mode 100644 index 000000000..1bf5a5e26 --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd.conffiles @@ -0,0 +1 @@ +/etc/mini_httpd.conf diff --git a/package/mini_httpd/ipkg/mini-httpd.control b/package/mini_httpd/ipkg/mini-httpd.control new file mode 100644 index 000000000..6466feed2 --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd.control @@ -0,0 +1,5 @@ +Package: mini-httpd +Priority: optional +Section: net +Description: A small HTTP server, built with SSL support using MatrixSSL. +Depends: libmatrixssl diff --git a/package/mini_httpd/ipkg/mini-httpd.postinst b/package/mini_httpd/ipkg/mini-httpd.postinst new file mode 100644 index 000000000..dfcafaa9e --- /dev/null +++ b/package/mini_httpd/ipkg/mini-httpd.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf '"NO" to disable, "-C /etc/mini_httpd.conf" otherwise' mini_httpd_flags diff --git a/package/mini_httpd/patches/patch-Makefile b/package/mini_httpd/patches/patch-Makefile new file mode 100644 index 000000000..5a574b21c --- /dev/null +++ b/package/mini_httpd/patches/patch-Makefile @@ -0,0 +1,78 @@ +$Id$ +--- mini_httpd-1.19.orig/Makefile 2002-11-01 23:02:57.000000000 +0000 ++++ mini_httpd-1.19/Makefile 2007-03-20 13:35:49.000000000 +0000 +@@ -14,30 +14,44 @@ CRYPT_LIB = -lcrypt + # http://www.openssl.org/ Make sure the SSL_TREE definition points to the + # tree with your OpenSSL installation - depending on how you installed it, + # it may be in /usr/local instead of /usr/local/ssl. ++ ++# OpenSSL + #SSL_TREE = /usr/local/ssl + #SSL_DEFS = -DUSE_SSL + #SSL_INC = -I${SSL_TREE}/include + #SSL_LIBS = -L${SSL_TREE}/lib -lssl -lcrypto ++#SSL_OBJS = + ++# MatrixSSL ++#SSL_TREE = ++#SSL_DEFS = -DUSE_SSL -DHAVE_MATRIXSSL ++#SSL_INC = ++#SSL_LIBS = -lmatrixssl ++#SSL_OBJS = matrixssl_helper.o + +-BINDIR = /usr/local/sbin +-MANDIR = /usr/local/man +-CC = gcc ++ ++DESTDIR = ++ ++BINDIR = $(DESTDIR)/usr/sbin ++MANDIR = $(DESTDIR)/usr/share/man ++CC ?= gcc + CDEFS = ${SSL_DEFS} ${SSL_INC} +-CFLAGS = -O ${CDEFS} +-#CFLAGS = -g ${CDEFS} +-LDFLAGS = -s ++CFLAGS += ${CDEFS} ++LDFLAGS ?= + #LDFLAGS = -g + LDLIBS = ${SSL_LIBS} ${SYSV_LIBS} ${CRYPT_LIB} + + all: mini_httpd htpasswd + +-mini_httpd: mini_httpd.o match.o tdate_parse.o +- ${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${LDLIBS} -o mini_httpd ++mini_httpd: mini_httpd.o match.o tdate_parse.o ${SSL_OBJS} ++ ${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${SSL_OBJS} ${LDLIBS} -o mini_httpd + + mini_httpd.o: mini_httpd.c version.h port.h match.h tdate_parse.h mime_encodings.h mime_types.h + ${CC} ${CFLAGS} -c mini_httpd.c + ++matrixssl_helper.o: matrixssl_helper.c ++ ${CC} ${CFLAGS} -c matrixssl_helper.c ++ + match.o: match.c match.h + ${CC} ${CFLAGS} -c match.c + +@@ -71,16 +85,18 @@ mini_httpd.pem: mini_httpd.cnf + chmod 600 mini_httpd.pem + + +-install: all +- rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd ++install: all uninstall + -mkdir -p ${BINDIR} + cp mini_httpd htpasswd ${BINDIR} +- rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1 + -mkdir -p ${MANDIR}/man8 + cp mini_httpd.8 ${MANDIR}/man8 + -mkdir -p ${MANDIR}/man1 + cp htpasswd.1 ${MANDIR}/man1 + ++uninstall: ++ rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd ++ rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1 ++ + clean: + rm -f mini_httpd mime_encodings.h mime_types.h htpasswd mini_httpd.rnd *.o core core.* *.core + diff --git a/package/mini_httpd/patches/patch-mini_httpd_c b/package/mini_httpd/patches/patch-mini_httpd_c new file mode 100644 index 000000000..b1b3414d3 --- /dev/null +++ b/package/mini_httpd/patches/patch-mini_httpd_c @@ -0,0 +1,96 @@ +$Id$ +--- mini_httpd-1.19.orig/mini_httpd.c 2005-06-29 19:31:17.000000000 +0200 ++++ mini_httpd-1.19/mini_httpd.c 2007-01-20 19:48:49.000000000 +0100 +@@ -66,8 +66,14 @@ + #endif /* HAVE_SENDFILE */ + + #ifdef USE_SSL ++# ifdef HAVE_OPENSSL + #include <openssl/ssl.h> + #include <openssl/err.h> ++# else /* HAVE_OPENSSL */ ++# ifdef HAVE_MATRIXSSL ++# include "matrixssl_helper.h" ++# endif /* HAVE_MATRIXSSL */ ++# endif /* HAVE_OPENSSL */ + #endif /* USE_SSL */ + + extern char* crypt( const char* key, const char* setting ); +@@ -132,10 +138,10 @@ typedef long long int64_t; + #define CGI_NICE 10 + #endif /* CGI_NICE */ + #ifndef CGI_PATH +-#define CGI_PATH "/usr/local/bin:/usr/ucb:/bin:/usr/bin" ++#define CGI_PATH "/usr/bin:/bin:/usr/sbin:/sbin" + #endif /* CGI_PATH */ + #ifndef CGI_LD_LIBRARY_PATH +-#define CGI_LD_LIBRARY_PATH "/usr/local/lib:/usr/lib" ++#define CGI_LD_LIBRARY_PATH "/usr/lib:/lib" + #endif /* CGI_LD_LIBRARY_PATH */ + #ifndef AUTH_FILE + #define AUTH_FILE ".htpasswd" +@@ -193,7 +199,13 @@ static int listen4_fd, listen6_fd; + static int do_ssl; + static char* certfile; + static char* cipher; ++#ifdef HAVE_OPENSSL + static SSL_CTX* ssl_ctx; ++#else /* HAVE_OPENSSL */ ++ #ifdef HAVE_MATRIXSSL ++static sslKeys_t* keys; ++ #endif /* HAVE_MATRIXSSL */ ++#endif /* HAVE_OPENSSL */ + #endif /* USE_SSL */ + static char cwd[MAXPATHLEN]; + static int got_hup; +@@ -540,6 +552,7 @@ main( int argc, char** argv ) + #ifdef USE_SSL + if ( do_ssl ) + { ++# ifdef HAVE_OPENSSL + SSL_load_error_strings(); + SSLeay_add_ssl_algorithms(); + ssl_ctx = SSL_CTX_new( SSLv23_server_method() ); +@@ -559,6 +572,17 @@ main( int argc, char** argv ) + exit( 1 ); + } + } ++# else /* HAVE_OPENSSL */ ++# ifdef HAVE_MATRIXSSL ++ matrixSslOpen(); ++ if ( matrixSslReadKeys( &keys, certfile, certfile, NULL, NULL ) < 0 ) ++ { ++ syslog( LOG_CRIT, "can't load certificate and/or private key\n"); ++ (void) fprintf( stderr, "%s: can't load certificate and/or private key\n", argv0 ); ++ exit( 1 ); ++ } ++# endif /* HAVE_MATRIXSSL */ ++# endif /* HAVE_OPENSSL */ + } + #endif /* USE_SSL */ + +@@ -1174,6 +1198,7 @@ handle_request( void ) + #ifdef USE_SSL + if ( do_ssl ) + { ++# ifdef HAVE_OPENSSL + ssl = SSL_new( ssl_ctx ); + SSL_set_fd( ssl, conn_fd ); + if ( SSL_accept( ssl ) == 0 ) +@@ -1181,6 +1206,16 @@ handle_request( void ) + ERR_print_errors_fp( stderr ); + exit( 1 ); + } ++# else /* HAVE_OPENSSL */ ++# ifdef HAVE_MATRIXSSL ++ ssl = SSL_new(keys); ++ SSL_set_fd( ssl, conn_fd ); ++ if ( SSL_accept( ssl ) <= 0 ) ++ { ++ perror( "SSL_accept" ); ++ } ++# endif /* HAVE_MATRIXSSL */ ++# endif /* HAVE_OPENSSL */ + } + #endif /* USE_SSL */ + |