Hi All,
Im trying to establish a SSL connection to a server for authentication.
Without this i cannot proceed.
The documentation on SSL in the Companion does give some pointers but im
sure there is more to it.
There is nothing mentioned on how to resolve errors if we get any.
Right now, im getting an error called 'sslErrVerifyConstraintViolation' .
The documentation says "The certificate violates an X509 extension ".
What is this supposed to mean? Do i have to study the SSL protocol before i
get into this? Isnt there a straight forward approach of doing it? (i
managed to do the same on Windows btw. Wasnt so much effort :-)).
Here's what ive got.

// find the SSL library
 sslError = SysLibFind(kSslDBName, &sslLibRefUShort);

 if(sslError == sysErrLibNotFound)
 {
  errLong = SysLibLoad(kSslLibType, kSslLibCreator, &sslLibRefUShort);
  }

 // open the library
 sslError = SslLibOpen(sslLibRefUShort);


 // Create an SslLib object (which acts as an
 // 'SSL context template') and then use the object to 'spawn'
 // an SslContext object. The latter object represents a
 // 'real' SSL context (or environment). All further
 // SSL operations will be in reference to this SslContext
 // object.
 sslError = SslLibCreate(sslLibRefUShort, &contextTemplate);

 sslError = SslContextCreate(sslLibRefUShort, contextTemplate, &context);

 // lets connect to the SSL Server before making a request.
 if(!ConnectToSSLServer(SSLSRV_HOST, SSLSRV_PORT))
 {
  // do clean up, show error message
  return ;
 }

 // we have connected to the ssl server successfully
 // Set the socket into the context.
 SslContextSet_Socket(sslLibRefUShort, context, SSLServerSocket);

 // Apply SSL to the socket. This is done by 'opening'
  // a new SSL session.
  SslOpen(sslLibRefUShort, context, sslOpenModeSsl |
sslOpenUseDefaultTimeout, 0);

 StrCopy(sendBuff, https://someserver.com/somepage.asp);

 retULong = SslWrite(sslLibRefUShort, context, sendBuff, StrLen(sendBuff),
&sslError);

-----------------------> at this point sslError =
'sslErrVerifyConstraintViolation'

 retULong = SslRead(sslLibRefUShort, context, readBuff, 1000, &sslError);


Im sure there is more to it than wat i have done there. Is there a proper
procedure like get a certificate, establish a handshake,etc????
Any help will be appreciated. Thanking in advance.

Rakesh.



"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/

Reply via email to