Re: Accessing OpenSSL functions from CFM Carbon under Tiger
Re: Accessing OpenSSL functions from CFM Carbon under Tiger
- Subject: Re: Accessing OpenSSL functions from CFM Carbon under Tiger
- From: Eric Arlotti <email@hidden>
- Date: Tue, 5 Jul 2005 15:41:01 +0200
Thanks for the information, Daniel.
I don't understand why it works on Panther, but it works (and whatever the framework, which is really surprising !) .
Following your advice, I began to build my own framework to act as a wrapper to OpenSSL dylib. I found something very surprising again : my framework is empty at the moment, it has no code, it doesn't link with any libraries (except Carbon.framework), if I load my framework with "LoadFrameworkBundle" from my CFM code, then I can get the function pointer to SSL_xxx functions, even under Tiger !
It means that the following code now works under Tiger :
LoadFrameworkBundle(CFSTR("myEmptyFramework.framework"), &bundleRef);__SSL_library_init = (SSL_library_initPP) CFBundleGetFunctionPointerForName(bundleRef, CFSTR("SSL_library_init"));
The only difference is that a load my own framework instead of a system's framework... Strange, isn't it ?
I will post a question to the darwin-dev list to have more information about this and to have tips on how to load a dylib.
Thanks again for your help.
Eric
Le 4 juil. 05, à 22:37, Daniel Jalkut a écrit :
It sounds like you were depending on a huge coincidence in Panther, and that coincidence disappeared in Tiger.
As far as I know, the SSL functions are not advertised as being part of any framework on OS X. They are supposed to be accessed directly from the libssl dylib. Examining my Panther system, I can't see anything obvious that explains why the bundle calls were working for you even on Panther.
I don't think CFBundle can load entry points from a dylib directly. Since you can't (I don't think) access the DYLD functions directly from CFM, either, you might have to come up with some kind of bundle interface of your own that links to and re-exports from libssl. You might find some more info by searching the list archives for more general OS X programming topics.
Daniel
On Jul 4, 2005, at 1:08 AM, Eric Arlotti wrote:
This works great under Panther but it fails under Tiger : CFBundleGetFunctionPointerForName returns NULL for some OpenSSL functions (all those that begin with "SSL_") but not for BSD sockets functions. I thought that something had changed with Tiger, so I tried to load "System.framework" or "Security.framework" instead of ''ApplicationServices.framework'" but this gave the same result.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden