Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated errors #3

Open
cellininicholas opened this issue Apr 5, 2012 · 3 comments
Open

Deprecated errors #3

cellininicholas opened this issue Apr 5, 2012 · 3 comments

Comments

@cellininicholas
Copy link

Hey I tried running the program on Xcode v4.3.2 and I get errors saying:
CSSM_DATA is deprecated
SecCertificateCreateFromData is deprecated

When I try to run send a push message, the program crashes in iosock.c
OSStatus SocketWrite(
...
// at:
length = write(sock,
(char*)dataPtr + bytesSent,
dataLen - bytesSent);

Any ideas as to why this is happening?

Thanks :)

@stefanhafeneger
Copy link
Owner

I haven't worked on this project since the introduction of APNS. Please use the wiki or the issue tracker so that other people can look into this.

@flomll
Copy link

flomll commented Oct 23, 2012

I have the same problem. Have anyone a solution for the problem? Currently I use XCode 4.5.

@khan-lau
Copy link

open ApplicationDelegate.m, and try this

//  // Create certificate.
//  NSData *certificateData = [NSData dataWithContentsOfFile:self.certificate];
//  CSSM_DATA data;
//  data.Data = (uint8 *)[certificateData bytes];
//  data.Length = [certificateData length];
//  result = SecCertificateCreateFromData(&data, CSSM_CERT_X_509v3, CSSM_CERT_ENCODING_BER, &certificate);
//  NSLog(@"SecCertificateCreateFromData(): %d", result);


    // Create certificate.
    NSData* certData = [NSData dataWithContentsOfFile:self.certificate];

    if( [certData length] ) {
        certificate = SecCertificateCreateWithData( kCFAllocatorDefault, (__bridge CFDataRef)certData );
        if( certificate != NULL ) {
            SecPolicyRef myPolicy = SecPolicyCreateBasicX509();
            SecTrustRef myTrust;
            result = SecTrustCreateWithCertificates(certificate, myPolicy, &myTrust);

        } else {
            NSLog(@"error: trying to create the SSL certificate from data located at %@, but failed", self.certificate);
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants