From: Bradley Nicholes Date: Thu, 8 May 2003 16:08:43 +0000 (+0000) Subject: Allow blind accept when converting the proxy client socket to SSL if no client X-Git-Tag: pre_ajp_proxy~1731 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b5947ebe8e9fae2048159c0f02755559a183e3e;p=thirdparty%2Fapache%2Fhttpd.git Allow blind accept when converting the proxy client socket to SSL if no client certificates have been provided. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99738 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/arch/netware/mod_nw_ssl.c b/modules/arch/netware/mod_nw_ssl.c index b5cc8e80512..a931cf8f332 100644 --- a/modules/arch/netware/mod_nw_ssl.c +++ b/modules/arch/netware/mod_nw_ssl.c @@ -285,8 +285,10 @@ int convert_secure_socket(conn_rec *c, apr_socket_t *csd) int rcode; struct tlsclientopts sWS2Opts; struct nwtlsopts sNWTLSOpts; - unsigned long ulFlags; + struct sslserveropts opts; + unsigned long ulFlags; SOCKET sock; + unicode_t keyFileName[60]; apr_os_sock_get(&sock, csd); @@ -295,7 +297,7 @@ int convert_secure_socket(conn_rec *c, apr_socket_t *csd) memset((char *)&sNWTLSOpts, 0, sizeof(struct nwtlsopts)); /* turn on ssl for the socket */ - ulFlags = SO_TLS_ENABLE; + ulFlags = (numcerts ? SO_TLS_ENABLE : SO_TLS_ENABLE | SO_TLS_BLIND_ACCEPT); rcode = WSAIoctl(sock, SO_TLS_SET_FLAGS, &ulFlags, sizeof(unsigned long), NULL, 0, NULL, NULL, NULL); if (SOCKET_ERROR == rcode) @@ -305,33 +307,30 @@ int convert_secure_socket(conn_rec *c, apr_socket_t *csd) return rcode; } - /* setup the socket for SSL */ - sWS2Opts.wallet = NULL; /* no client certificate */ - sWS2Opts.walletlen = 0; - sWS2Opts.sidtimeout = 0; - sWS2Opts.sidentries = 0; - sWS2Opts.siddir = NULL; - sWS2Opts.options = &sNWTLSOpts; - - sNWTLSOpts.walletProvider = WAL_PROV_DER; //the wallet provider defined in wdefs.h - sNWTLSOpts.TrustedRootList = certarray; //array of certs in UNICODE format - sNWTLSOpts.numElementsInTRList = numcerts; //number of certs in TRList - sNWTLSOpts.keysList = NULL; - sNWTLSOpts.numElementsInKeyList = 0; - sNWTLSOpts.reservedforfutureuse = NULL; - sNWTLSOpts.reservedforfutureCRL = NULL; - sNWTLSOpts.reservedforfutureCRLLen = 0; - sNWTLSOpts.reserved1 = NULL; - sNWTLSOpts.reserved2 = NULL; - sNWTLSOpts.reserved3 = NULL; - - + memset (&sWS2Opts, 0, sizeof(sWS2Opts)); + memset (&sNWTLSOpts, 0, sizeof(sNWTLSOpts)); + sWS2Opts.options = &sNWTLSOpts; + + if (numcerts) { + sNWTLSOpts.walletProvider = WAL_PROV_DER; //the wallet provider defined in wdefs.h + sNWTLSOpts.TrustedRootList = certarray; //array of certs in UNICODE format + sNWTLSOpts.numElementsInTRList = numcerts; //number of certs in TRList + } + else { + /* setup the socket for SSL */ + unicpy(keyFileName, L"SSL CertificateIP"); + sWS2Opts.wallet = keyFileName; /* no client certificate */ + sWS2Opts.walletlen = unilen(keyFileName); + + sNWTLSOpts.walletProvider = WAL_PROV_KMO; //the wallet provider defined in wdefs.h + } + /* make the IOCTL call */ - rcode = WSAIoctl(sock, SO_TLS_SET_CLIENT, &sWS2Opts, - sizeof(struct tlsclientopts), NULL, 0, NULL, - NULL, NULL); - + rcode = WSAIoctl(sock, SO_TLS_SET_CLIENT, &sWS2Opts, + sizeof(struct tlsclientopts), NULL, 0, NULL, + NULL, NULL); + /* make sure that it was successfull */ if(SOCKET_ERROR == rcode ){ ap_log_error(APLOG_MARK, APLOG_ERR, 0, c->base_server,