Hi,
you don't need the SysLibLoad function cause it's a part of PalmOS. I think
this Function is for custom libs. If you want to communicate over a SSL
socket you also need the NetLib. I 've done somethink like this:
________________________________________________________________________
err = SysLibFind ("Net.lib", &AppNetRefnum);
if (!err )
{
/* If the library is not loaded, load the library*/
error = NetLibOpen (AppNetRefnum, &ifErr);
if (!error)
{
outputTextHandle=AppendStringToHandle("Net.lib opened
successfully\n",outputTextHandle);
/* the outputTextHandle function just generates an output an the
screen. */
}
else if (error == netErrAlreadyOpen)
{
outputTextHandle=AppendStringToHandle("Net.lib already
open\n",outputTextHandle);
}
else
{
outputTextHandle=AppendStringToHandle("Error opening
Net.lib\n",outputTextHandle);
}
}
else
{
outputTextHandle=AppendStringToHandle("Net.lib not found !!
\n",outputTextHandle);
}
if(g_prefs.enableSsl)
{
err = SysLibFind (kSslDBName, &SslLibRefnum);
if (err )
{
err=SysLibLoad (kSslLibType,kSslLibCreator,&SslLibRefnum);
}
if(!err)
{
/* If the library is not loaded, load the library*/
error = SslLibOpen (SslLibRefnum);
if (error == errNone)
{
outputTextHandle=AppendStringToHandle("SSL Lib opened
successfully\n",outputTextHandle);
}
/* else if (error == netErrAlreadyOpen)
{
outputTextHandle=AppendStringToHandle("SSL Lib already
open\n",outputTextHandle);
}
*/ else
{
outputTextHandle=AppendStringToHandle("Error opening ssl
lib\n",outputTextHandle);
}
}
else
{
outputTextHandle=AppendStringToHandle("SSL lib not found !!
\n",outputTextHandle);
}
SslLibCreate (SslLibRefnum,&contextTemplate);
SslContextCreate(SslLibRefnum,contextTemplate,&context);
_____________________________________________________________________
then you need to create a NetLib socket and add it to the ssl context with
SslContextSet_Socket(SslLibRefnum,context,netLibSocket). And finaly you can
send data over the socket with bytesSent=SslWrite(SslLibRefnum, context,
dataBuffer, bytesToSend,&error) or read data with
bytesRead=SslWrite(SslLibRefnum, context, dataBuffer, bytesToRead,&error).
I hope this summary of my code helps you.
Best regards Philippe.
----- Original Message -----
From: "Rakesh Pai" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, November 07, 2003 7:43 AM
Subject: using SSL on Palm OS
> Hi,
> Im trying to make a SSL connection to a server using the SSL Api's
> on Palm OS 5.2. The documentation that i could find isnt really
> helping me. For example,
> SysLibLoad(kSslLibType, kSslLibCreator, &libRef ); says one sample
> code. What is the libtype and libcreater param for SslLib.lib? and is
> there an SslLib.lib?. I couldnt find SslLib.lib on my machine.
> Also, once i send a request using the Ssl API's...how can i read the
> raw data from the data received for me to extract some information?
> Any help will be appreciated.
>
> Thanx.
>
> --
> "Reality is an Illusion, although a persistent one"
> ~Albert Einstein~
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/