unity openssl facebook

How to OpenSSL for Unity 5

How to OpenSSL for Unity 5

What is OpenSSL

OpenSSL is a tool used to create a key for mobile apps on Facebook. For anyone who doesn’t use command prompt, like ever, figuring out how to use this tool sucks. So, for my sanity when making my next app, and for anyone else’s sanity who is sick of looking at tutorials from people who don’t know how to give proper detailed directions to people who are learning, I created this tutorial. Please keep in mind, I am using Windows 7, 64 bit, and I am using Unity 5.

how to openssl unity

Step 1

Download the current OpenSSL zip file.

The links:

Step 2

Unzip the file. Open up your C: drive. create a folder (directory) named OpenSSL. Open this folder. Paste the contents of the folder you just unzipped into the OpenSSL folder.

Step 3

Make sure all of your hidden files can be seen. Directions to unhide your files are here.

Step 4

Now, open the directory .android. On my machine, it looks like this:

C:\\Users\\Kendra\\.android

Step 5

See if the debug.keystore file is there. If it is, skip ahead to step 7. If it is not, continue to step 6.

Step 6

Launch your Android Studio and create a new project. Once the project is created, check to make sure that a debug.keystore file has been created in your .android directory.

Step 7

Copy the debug.keystore file from your .android folder and paste into your JDK bin Folder. On my machine, it is this:

C:\\Program Files\\Java\\jdk1.7.0_79

Step 8

Open the command prompt. You can find it at Start Menu > All Programs > Accessories > Command Prompt.

Step 9

Copy the following code and paste it into a text editor like notepad or sticky-notes.

“C:\\Program Files\\Java\\jdk1.7.0_79\\bin\\keytool.exe” -exportcert -alias androiddebugkey -keystore “C:\\Users\\Kendra.android\\debug.keystore” | “C:\\openssl\\bin\\openssl.exe” sha1 -binary | “C:\\openssl\\bin\\openssl.exe” base64

Step 10

Make sure that you replace my paths, with the paths that you have. Your “jdk1.7.0_79” may be different and your username (where “Kendra” is in the script) is probably different.

Step 11

Copy your script and paste it into your Command Prompt. You will need to right click and select paste since you cannot use your keyboard shortcuts.

Step 12

Hit the Enter key on your keyboard.

Your Command Prompt should spit out some letters and numbers on the next line. Now check your Unity 5 project. The error saying that your key should be gone. If it is gone, you are good to go.

If your Unity project is still displaying an error, it is probably something along the line of OpenSSL not found. You will need to add the OpenSSL directory to your path. Continue on.

Step 13

Go to: Start Menu > Control Panel\\System and Security\\System and select from the left column, Advanced System Settings. Click the Environmental Variables.

Step 14

Under the System Variables section, scroll down the “Path” and select it. Click the “Edit” button.

Step 15

Add the path to your OpenSSL bin folder. I added “;C:\\openssl\\bin” to the end of the text line. Do not forget the semicolon before the C. Click the OK button until you are out of Advanced System Settings. (this should be 3 times for you to hit OK)

Restart your Unity and open your project.

Select the Facebook tab > Edit Settings. That error should be gone. If you no longer have errors, you are done. If you still have errors, it probably looks something like key tool not found. Continue on.

Step 16

You will need to add the JDK (Java Development Kit) bin directory to the Path variable value text line.

Once again, go to Start Menu > Control Panel\\System and Security\\System and select from the left column, Advanced System Settings. Click the Environmental Variables. Under the System Variables section, scroll down the “Path” and select it. Click the “Edit” button.

Step 17

Add the JDK bin path. I added “;C:\\Program Files\\Java\\jdk1.7.0_79\\bin” to the end of the value text line. Once again, don’t forget the semicolon.

Click the OK button until you are out of Advanced System Settings. (this should be 3 times for you to hit OK). Restart Unity, again, and open your project.

Select the Facebook tab > Edit Settings. That error should be gone. If you no longer have errors, you are done. If you still have errors, post them in the comments and I’ll see what I can do to help you out.

Conclusion

After following these steps, my Facebook developer dilemma was solved. It took me 4 days to figure this crap out. The only thing in my head right now is a stinky pile of poo that I dedicate to Facebook for making it so gosh darn difficult to do that. With all the apps and technology and plugins available, you’d think they could make it a little easier to get the stupid key.

Anyways, hope this helps you out. If you have any questions, post them in the comments. I’ll see what I can do to help you solve your issue. Also, I wrote a lot of this from memory, so if you see a step I may have skipped or it’s not working for you, let me know and I will try to help you out.

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *