SSLHandshake returns errSSLClosedAbort
SSLHandshake returns errSSLClosedAbort
- Subject: SSLHandshake returns errSSLClosedAbort
- From: Apparao Mulpuri <email@hidden>
- Date: Thu, 15 Jul 2010 19:23:05 -0700
Hi Folks,
I am trying to establish a SSL Connection and it was failing in SSLHandshake call and returning errSSLClosedAbort error without any clue. Here is my code snippet. I google a lot but couldn't find anything about this.
{
ret = SSLNewContext(false, &_ctx);
if(ret)
{
printSslErrStr("SSLNewContext", ret);
if(_ctx)
{
SSLDisposeContext(_ctx);
}
}
ret = SSLSetProtocolVersion(_ctx, kTLSProtocol1Only);
if(ret)
{
printSslErrStr("SSLSetProtocolVersion", ret);
if(_ctx)
{
SSLDisposeContext(_ctx);
}
}
ret = SSLSetConnection(_ctx, self);
if(ret) {
printSslErrStr("SSLSetConnection", ret);
if(_ctx)
{
SSLDisposeContext(_ctx);
}
}
ret = SSLSetIOFuncs(_ctx, ssl_read, ssl_write);
if(ret) {
printSslErrStr("SSLSetIOFuncs", ret);
if(_ctx)
{
SSLDisposeContext(_ctx);
}
}
ret = SSLSetAllowsExpiredCerts(_ctx, false);
if(ret)
{
printSslErrStr("SSLSetAllowExpiredCerts", ret);
if(_ctx)
{
SSLDisposeContext(_ctx);
}
}
if(clientCerts)
{
ret = SSLSetCertificate(_ctx, clientCerts); //here I am passing CFArrayRef with self sign certificate
if(ret) {
printSslErrStr("SSLSetCertificate", ret);
if(_ctx)
{
SSLDisposeContext(_ctx);
}
}
}
ret = SSLGetSessionState(_ctx, &status);
if (ret)
{
printSslErrStr("SSLSetConnection", ret);
if(_ctx)
{
SSLDisposeContext(_ctx);
}
}
NSLog(@"status: %d", status);
}
if (_ctx)
{
do
{
ret = SSLHandshake(_ctx);
printSslErrStr("establishSecureHandshake", ret);
if(ret == errSSLWouldBlock)
{
NSLog(@"I/O would block (not fatal)");
}
} while (ret == errSSLWouldBlock);
}
_______________________________________________
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