Justin Erenkrantz wrote:
> On 6/13/06, david reid <[EMAIL PROTECTED]> 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!