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

2015-03-24 Thread Jerry OELoo
So, I can re-use g_ctx, but I need create a new g_ssl everytime, right?
BTW, X509_STORE *store = X509_STORE_new();  for store, Can I reuse it
as a global object?


On Wed, Mar 25, 2015 at 11:33 AM, Salz, Rich  wrote:
>> 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!
>
> You need to create a new SSL object every time you want to do a connect.
>
> /r$
>
> --
> Senior Architect, Akamai Technologies
> IM: richs...@jabber.at Twitter: RichSalz
>
>
> ___
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users



-- 
Rejoice,I Desire!
___
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


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

2015-03-24 Thread Salz, Rich
> 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!

You need to create a new SSL object every time you want to do a connect.

/r$

--  
Senior Architect, Akamai Technologies
IM: richs...@jabber.at Twitter: RichSalz


___
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


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

2015-03-24 Thread Jerry OELoo
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!
___
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users