[openssl-users] What global object I use in application lifetime

Jerry OELoo oyljerry at gmail.com
Wed Mar 25 03:25:38 UTC 2015


Hi.
Now when my application running, I will use SSL_connect() to connect
1000 different URLs.

I want to keep some openssl object as global variable then I do not
need to initialize/uninitialize again and again.

Here is my sample code.

g_ctx = SSL_CTX_new(method);
g_ssl = SSL_new(g_ctx );

//SSL_connect will connect 1000 URLs 1 by 1.

...

//release g_ctx and g_ssl

>From document, I think CTX can be initialize only once. But I do not
know g_ssl can be initialize only once? I can reuse g_ssl  for 1000
differnt URLs? Please correct me if anything. Thanks!


Best Regards
Jerry

-- 
Rejoice,I Desire!


More information about the openssl-users mailing list