Trouble getting key from keychain


#1

Following the instructions in the chapter, I am getting an error when trying to load the key from the keychain. The certificateArray function outputs error 25300 (item not found).

I then went back and exported the key directly from the keychain and used that file for the CocoaServer project. The error persists.

I am not sure what is going wrong. I will try doing an online tutorials or two and see if that brings any answers. (Can anyone recommend any good ones?)

I’ve found the book excellent until the last couple chapters. 28 and 29 have been fairly frustrating, with the sample code not showing consistently where new code was added or needed to be changed, and some changes made but not explained. I eventually just used the solution code downloaded from your site, which makes the printing the code in the chapter less useful.


#2

I get the same error, which appears to be related to the fact I can’t get any keys for the SSL certificate to appear in the Keychain. I’ve tried multiple times to create the certificates following the book instructions with no success in getting the SSL keys to appear in the Keychain, only the SSL certificate appears. I too am looking for other tutorials on how to get the certificates created correctly with the encoding keys. The last two chapters have been a real challenge and pretty frustrating. Great book though up to this point!

Fred


#3

[quote=“fredhkoch”]I get the same error, which appears to be related to the fact I can’t get any keys for the SSL certificate to appear in the Keychain. I’ve tried multiple times to create the certificates following the book instructions with no success in getting the SSL keys to appear in the Keychain, only the SSL certificate appears. I too am looking for other tutorials on how to get the certificates created correctly with the encoding keys. The last two chapters have been a real challenge and pretty frustrating. Great book though up to this point!

Fred[/quote]

After hours and hours of redoing SSL certificates I finally discovered the personal keys were being generated, just not using the name I entered in the generation process. The personal keys always used the same name (I don’t know where it comes from) which did not have any relationship to the name entered during the SSL certificate process, which is why I couldn’t find them before. I discovered this by checking the properties of the generated SSL certificates which stated the name of the personal key associated with that certificate.

The error message was not related to the personal key at all (since the personal key was there and the name contained in the SSL certificate). It was because the name of the SSL certificate in the server program did not exactly match the name in the bundle. A simple typo what was hard to find. Once the typo was fixed, the certificate was found and all is well. Human error strikes again! Unfortunately nothing indicated to me it was the file that could not be found.

Hope this saves someone else some time.

Fred