From dev-return-16635-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Fri Jun 16 19:32:15 2006 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 49878 invoked from network); 16 Jun 2006 19:32:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jun 2006 19:32:13 -0000 Received: (qmail 51333 invoked by uid 500); 16 Jun 2006 19:32:09 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 51158 invoked by uid 500); 16 Jun 2006 19:32:08 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 51097 invoked by uid 99); 16 Jun 2006 19:32:07 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 12:32:07 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of david@jetnet.co.uk designates 80.87.128.128 as permitted sender) Received: from [80.87.128.128] (HELO kosh.jetnet.co.uk) (80.87.128.128) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 12:31:31 -0700 Received: from localhost (localhost [127.0.0.1]) by kosh.jetnet.co.uk (Postfix) with ESMTP id 87A4E2108A; Fri, 16 Jun 2006 19:31:10 +0000 (GMT) Received: from kosh.jetnet.co.uk ([127.0.0.1]) by localhost (mail.jetnet.co.uk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 76770-02-2; Fri, 16 Jun 2006 19:31:09 +0000 (GMT) Received: from [192.168.2.10] (82-41-8-230.cable.ubr02.edin.blueyonder.co.uk [82.41.8.230]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by kosh.jetnet.co.uk (Postfix) with ESMTP id 8D35020F40; Fri, 16 Jun 2006 19:31:09 +0000 (GMT) Message-ID: <449306F8.3060801@jetnet.co.uk> Date: Fri, 16 Jun 2006 20:31:04 +0100 From: david reid User-Agent: Thunderbird 1.5.0.2 (X11/20060522) MIME-Version: 1.0 To: Justin Erenkrantz , dev@apr.apache.org Subject: Re: [PROPOSAL/PATCH] add ssl sockets References: <448F2FB5.6060906@jetnet.co.uk> <5c902b9e0606161222u6f60986ftaa82badf2b65f054@mail.gmail.com> In-Reply-To: <5c902b9e0606161222u6f60986ftaa82badf2b65f054@mail.gmail.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at jetnet.co.uk X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Justin Erenkrantz wrote: > On 6/13/06, david reid wrote: >> +static int sslInit = 0; >> + >> +static void initOpenSSL(void) >> +{ >> + SSL_library_init(); >> + OpenSSL_add_all_algorithms(); >> + OpenSSL_add_all_digests(); >> + SSL_load_error_strings(); >> + >> + sslInit = 1; >> +} > > FWIW, for serf, we settled upon the following invocation as the most > reliable sequence: > > CRYPTO_malloc_init(); > ERR_load_crypto_strings(); > SSL_load_error_strings(); > OpenSSL_add_all_algorithms(); > > (We use the same static var trick too.) > > http://svn.webdav.org/repos/projects/serf/trunk/buckets/ssl_buckets.c > > I know neon uses a different sequence too: > > SSL_load_error_strings(); > SSL_library_init(); > OpenSSL_add_all_algorithms(); > ...thread safe callback inits... > > http://svn.webdav.org/repos/projects/neon/trunk/src/ne_openssl.c > > If there's a reason or rationale to use a particular init sequence, > I'd love to know. > > But, the one for serf was the only one I could get that worked with > every OpenSSL version. Without the SSL_library_init() it didn't work for me. *shrug* Not sure the order should matter that much!