10

I'm trying to get started with Safari extension development, but I keep getting the "No Safari Extension Developer Certificate" error.

I followed the openssl instructions here: making CSR certificates in Windows (7)

I uploaded the CSR file to developer.apple.com, I downloaded the generated file and installed it in Personal and Trusted Root Certification Authorities stores. Nothing happens in the extension builder.

The top response here makes me think: Safari doesn't detect my Extension Certificate

It says "on another machine you don't have the private key associated with the cert".

I see the openssl command generated a private key file for me. Do I need to use it somewhere in Safari or somewhere else in the operating system?

I've been trying for a full day now and I'm getting a feeling like I'm missing something obvious here. Can you suggest what it could be?

Community
  • 1
  • 1
Rafał G.
  • 1,529
  • 22
  • 35
  • You're trying to do this on Windows? Apple has made major changes to their developer certificate pages, including removing all Windows instructions. At this point, I believe Windows is unsupported for developing Safari extensions unless you downloaded the Certificate before Apple made the changes. – Mike Kaply Jun 04 '13 at 15:16
  • I was able to resolve it eventually. I was going to post the solution here, but I never got around to it. I'll try to do it this week if I have some spare time. – Rafał G. Jun 05 '13 at 10:43
  • Please post the solution . .. I NEED IT – Rafik Bari Jun 28 '13 at 16:38
  • I wish Apple kept the original Windows instructions or that someone archived them. Still useful as a point of reference. – David Jan 27 '15 at 22:39
  • This may be kind of pointless going forward. Just got Apple email that Safari dev program will be merged into Apple (iOS/Mac) dev program, which is $99/yr just to release/publish official Safari extensions (to the gallery). This applies to extension updates as well. At that price, may as well get a Mac and build iOS and/or Mac apps too. – David Jun 10 '15 at 06:03

2 Answers2

30

Ok, here's a walkthrough.

On two of these steps you'll be asked to create password. You can go with an empty one - just press Enter.

  1. Get OpenSSL. There are a few options here, I got mine here. I downloaded the first thing (light version) and Visual C++ Redistributables (you might already have them, OpenSSL installer will warn you if you need to get them). I installed OpenSSL in C:\OpenSSL and selected to copy OpenSSL DLLs to the OpenSSL binaries directory.
  2. Run this command in the standard Windows terminal:

    set OPENSSL_CONF=c:\OpenSSL\bin\openssl.cfg

  3. Then this one (as for details, I only entered my name and email, but probably even those are not required for Apple):

    c:\OpenSSL\bin\openssl.exe req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key

  4. Upload the new file CSR.csr in the Certificates section on developer.apple.com. You'll get a file called safari_extension.cer in return.
  5. Run this:

    c:\OpenSSL\bin\openssl x509 -in safari_extension.cer -inform DER -out safari_extension_PEM.cer -outform PEM

  6. And this:

    c:\OpenSSL\bin\openssl pkcs12 -export -in safari_extension_PEM.cer -inkey privateKey.key -out bundle.p12

  7. Double click safari_extension.cer. Install it in the Personal certificate store.

  8. Double click bundle.p12. Install it in the same store.

That's it. Open Safari and it should know about the certificate.

Rafał G.
  • 1,529
  • 22
  • 35
  • is there a qucker/easier method if you just need to renew a certificate? or does one have to go through all those steps to renew too? btw i notice that windows has a built in tool called CertUtil which you can run by typing certutil, can that not be used instead of installing extra software? – user280109 Aug 02 '13 at 17:08
  • 3
    This is a bit involved, but it works. I used windows7 64 bit. Not sure if this is worth mentioning, but if you are running a 64bit version of windows make sure you download a 64bit version of the C++ redist, and 64bit OPENSSL. You will need to adjust your directory to OpenSSL-Win64(or whichever it was named as). NOTE: Make sure to run CMD in admin mode! Also On step 6, you will be prompted for a password, you can bypass it by adding -password pass:1234 to the command. Also take note that the generated *_PEM and *.cer needs to be in which ever directory you are running these commands from – Tyler Rafferty Dec 03 '13 at 06:31
  • 1
    I have 64 bit Windows 7 too and I didn't need to download 64 bit versions of the executables. Nor did I need to run CMD as an admin. If my solution doesn't work for someone they can try Tyler's amendments, but it should work in its current form. – Rafał G. Dec 03 '13 at 13:44
  • I don't see an upload option in Apple Developer (step 4). Does this no longer work? – user984003 Aug 08 '15 at 16:03
  • @user984003 I'm not sure. They made it a part of their new exciting Apple Developer Program that you have to pay for, so perhaps they moved things around a little. I see a heading that reads "Certificates, identifiers & Profiles" [here](https://developer.apple.com/account/overview.action), but I'm not sure if the upload button is there - my company doesn't work on any Safari extensions at the moment, so I don't have the program. – Rafał G. Aug 09 '15 at 17:20
0

FYI, there's another method found here:

https://apple.stackexchange.com/a/169271/24632

original URL/post:

http://smarttechie.org/2013/12/13/how-to-create-apple-safari-extension-developer-certificate-for-windows/

Community
  • 1
  • 1
David
  • 3,223
  • 3
  • 29
  • 41