Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4620800
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:36:33+00:00 2026-05-22T02:36:33+00:00

I apologize in advance for the long-winded question. I’m having trouble with a self-signed

  • 0

I apologize in advance for the long-winded question. I’m having trouble with a self-signed SSL cert and I want to document everything I’ve tried so far.

I’m working on an app that communicates with a REST service. The test server uses a self-signed ssl certificate that I can install on my computer without issue. It’s a .p12 file that requires a password to install. Without this certificate installed, all requests to the server return a 403.

The .p12 installs three items in the Keychain, a “Root certificate authority”, a “test user” certificate that’s issued by the “Root certificate authority”, and a private key that’s associated with the “test user” cert.

I’ve installed this certificate on my iPad by emailing myself the .p12 file. I tapped on the attachment, input the password, and I can now access the site in Safari. Unfortunately, because of application sandboxing, this isn’t enough to get my app to communicate with the REST service.

I’m using ASIHTTPRequest for all of the communication with the REST service from my app. Each request is a subclass of ASIHTTPRequest. The first thing I found I had to do was call [self setValidatesSecureCertificate:NO]; so that it would even attempt the SSL connection to the server. If that’s all I do, I get 403 error codes back from the service.

Now I can’t seem to figure out how to get the request to use the certificate. I’ve tried exporting the three items as separate .cer file, including them in the project and adding them to the request using the code below:

NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"cert" ofType:@"cer"]];
SecCertificateRef cert = SecCertificateCreateWithData(NULL, (CFDataRef)data);
...
[self setClientCertificates:[NSArray arrayWithObjects:(id)cert, ..., nil]];

While the code executes without issue using this approach, I still get the 403 error.

I’ve even tried including the .p12 file in my application and importing it using the same code. This fails because SecCertificateCreateWithData returns nil.

I admit I don’t really know what I’m doing here. This is all a little over my head and any help anyone could give me would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:36:34+00:00Added an answer on May 22, 2026 at 2:36 am

    OK, I figured it out. I was sort of barking up the wrong tree.

    The most important information I found was in Apple’s documentation for Certificate, Key, and Trust Services Programming Guide, in particular, the “Tasks for iOS” page. That detailed how to extract the security identity from the .p12 file and how to add a trust exception.

    The last piece of the puzzle was in ASIHTTPRequest’s documentation on Client Certificate Support. By using the identity I extracted directly from the p12 file, I was able to pass that on to the request and get everything authenticated properly.

    I hope this helps anyone else that has to implement a similar feature.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apologize in advance for the long-winded question but I wanted to make sure
Apologies in advance for the long-winded question. I'm really a database programmer, but have
I apologize in advance; this is a long question. I've tried to simplify as
I apologize in advance for the long post... I used to be able to
I apologize in advance if this question seems remedial. Which would be considered more
Let me apologize in advance for the simplicity of this question (I heard Jeff's
I'm sure this has already been asked and answered so I apologize in advance
I'm a complete Flex noob, so I apologize in advance if I'm missing something
I apologise in advance if this question isn't very specific. Would it be possible
I apologize for asking such a generalized question, but it's something that can prove

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.