2011/3/7 Dave Thompson <dthomp...@prinpay.com>
> > From: owner-openssl-us...@openssl.org On Behalf Of ikuzar > > Sent: Monday, 07 March, 2011 10:00 > > > I have a function my_initialize( ) which initialize a lot > > of thing before doing my_connect( ), my_accept( ), etc. > > > In my_initialize( ), I call : > > - SSL_library_init(); > > - SSL_load_error_strings(); > > > In my_connect( ), I set handshake: > > - meth = TLSv1_method( ); > > - ctx = SSL_CTX_new(meth); > > - SSL_CTX_set_cipher_list( ) > > - SSL_CTX_use_certificate_file( ) > > - ... > > Presumably also (at least) use_PrivateKey (matching the cert) > and ending with ssl = SSL_new (ctx). > => That's OK > > - SSL_connect( ) > > > now, I have to load certificate in my_initialize( ) > > and not in my_connect( ). How must I tell SSL_connect ( ) > > that the certificate is already loaded in my_initialize( ) > > and it must use this certificate to process handshake ? > > Create and set-up ctx (SSL_CTX object) in initialize, and > later use ctx to create an SSL object for the/each connection. > This is exactly why SSL_CTX exists: to store, once and possibly > in advance, the parameters for possibly multiple connections. > => I exactly did it. But the guy who started developping the project had > build a certmanager class. He loaded certificates into a cache in > certmanager. He loaded certificates in my_initialize( ) and added them into > certmanager... He did not use openssl, he simulated what openssl do. For the > moment I have to continue his work and later, I 'll change it. > > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List openssl-users@openssl.org > Automated List Manager majord...@openssl.org >