How to OpenSSL for Unity 5

Epicurus-Unvorsum-openssl-hell-Unity

What is OpenSSL

Open SSL 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.

Step 1

Download the current openssl zip file. The link is here.

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 is this:
C:\Users\Kendra\.android

Step 5

See if the debug.keystore file is there. If it is, skip 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 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 stickynotes.

"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 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 Keytool 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. 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 (the whole first section), so if you see a step I may have skipped or it’s not working for you, let me know and I will help you out.


Also, if you find any issues with things, or have any suggestions, I would love to hear them! Email me here or report an issue or bug here.


I love to be social with you all! Don’t forget to follow Eimear Studios on Facebook and Twitter! I have lots of socialness to share, there’s more at the top right of this page!
 

 

61 thoughts on “How to OpenSSL for Unity 5

  • October 31, 2015 at 9:34 pm
    Permalink

    THANK YOU SO MUCH YOU ARE MY HERO

    Reply
    • October 31, 2015 at 11:35 pm
      Permalink

      You’re very welcome. I’m glad it helped πŸ™‚

      Reply
  • December 16, 2015 at 10:19 pm
    Permalink

    After 2 days of smashing my head on the keyboard trying to fix this, I’ve decided to just follow your guide to the letter and the problem went away. Good on you, ma’am.

    Also, you might want to mention that one should not add white spaces when adding to the environment variable, otherwise it’ll just refuse to link.

    Reply
    • December 16, 2015 at 11:37 pm
      Permalink

      Hi Yu! lmao. I’m glad it helped. I was doing the same thing when I tried to figure this out.

      Reply
  • March 14, 2016 at 9:44 am
    Permalink

    God Bless You!!! Because I will bless you for more than 2 days from now!

    Reply
    • March 14, 2016 at 12:38 pm
      Permalink

      Haha, thank you? I’m glad this helps πŸ˜€

      Reply
  • March 26, 2016 at 2:50 pm
    Permalink

    Thanks a lot, man!
    Very usefull article!
    God Bless You!!!
    =D

    Reply
    • March 27, 2016 at 12:11 am
      Permalink

      You’re very welcome πŸ™‚ And it’s woman πŸ˜‰

      Reply
  • April 13, 2016 at 4:44 am
    Permalink

    Just want to say thanks for help. It’s save my life. 2-3 days with this problem. Thanks

    Reply
    • April 13, 2016 at 8:18 am
      Permalink

      I’m glad it helped. I struggled with it as well, which is why I posted this. πŸ˜€

      Reply
  • April 25, 2016 at 2:48 am
    Permalink

    follow your guidelines …..
    adding ; at the start of paths not solve my problem …..
    ; not let me to add paths for me … so i just remove ; from paths and problem is solved ….
    because of you i dont smash my head on keyboard ….
    Thanks ….

    Reply
    • April 25, 2016 at 8:11 am
      Permalink

      I’m glad you’re not smashing your head!

      Reply
  • April 27, 2016 at 10:43 am
    Permalink

    Yep, now it works as it should. Thanks a lot!

    Reply
    • May 7, 2016 at 1:02 am
      Permalink

      You’re very welcome! I’m glad it helped! Sorry I didn’t respond sooner; I never got a notification :O

      Reply
  • May 8, 2016 at 9:00 pm
    Permalink

    You are awesome!! I’ve been banging my head trying to get a project up and running and your steps made this one aggravation much smaller. I look forward to reading more of your blog.

    Reply
    • May 8, 2016 at 9:17 pm
      Permalink

      lol! Thanks David! I’m glad it helped!

      Reply
  • June 2, 2016 at 9:00 am
    Permalink

    Thanks, this helped me, although it didn’t work initially, after this I uninstalled older updates of java and openSSL, which then worked, so thanks for putting this up πŸ™‚

    Reply
    • June 2, 2016 at 9:10 am
      Permalink

      You’re very welcome! I’m glad it helped πŸ˜€

      Reply
  • June 5, 2016 at 10:35 pm
    Permalink

    The guide still worked!!!. Thanks alot!!!

    Reply
    • June 5, 2016 at 10:37 pm
      Permalink

      You’re very welcome! I’m glad it helped πŸ˜€

      Reply
  • June 27, 2016 at 10:14 am
    Permalink

    Hello there, very good tutoriel that saves a lot of time ! Thnaks so much =D

    Reply
    • June 27, 2016 at 5:47 pm
      Permalink

      Thanks for the compliment, and I’m glad it helped πŸ˜€

      Reply
  • July 19, 2016 at 4:34 am
    Permalink

    awesome … worked and you are huge time save and helped alot . Thanks alot

    Reply
    • July 19, 2016 at 8:16 am
      Permalink

      You’re very welcome Billy.

      Reply
  • July 19, 2016 at 9:20 am
    Permalink

    This article is a lifesaver… Still can’t figure it out but now I fully understand the environmental paths.. If only I could depict Elmer Fudd shooting himself in the toe while attempting to shoot Bugs Bunny…

    Reply
    • July 19, 2016 at 11:54 am
      Permalink

      Yah.. this was a doozy for me.. which is why I wrote the article. I’m glad it’s helping so many people. I don’t have a pic of Elmer Fudd and bugs, but I’m imagining it for sure.

      Reply
    • July 22, 2016 at 9:47 am
      Permalink

      You’re welcome πŸ˜€

      Reply
  • August 1, 2016 at 2:04 am
    Permalink

    Very useful and detail describe! Thank you so much!

    Reply
    • August 1, 2016 at 8:14 am
      Permalink

      You’re welcome! I’m glad you found it useful πŸ˜€

      Reply
  • August 3, 2016 at 3:04 pm
    Permalink

    Thank you. This should be the top google search for anything relating to OpenSSL facebook unity3d. You are a saint.

    Reply
    • August 3, 2016 at 3:12 pm
      Permalink

      Lol. Thank you. I don’t know if naming me a saint is in my future, but I’ll take your thanks for sure πŸ˜‰

      Reply
  • August 4, 2016 at 9:43 pm
    Permalink

    Thank you, sempai. You’re so stong!

    Reply
    • August 4, 2016 at 10:39 pm
      Permalink

      Lol. Umm.. Thank you! I’m glad my strength helped you out.

      Reply
    • August 13, 2016 at 12:12 pm
      Permalink

      You’re very welcome πŸ˜€

      Reply
  • October 6, 2016 at 1:21 am
    Permalink

    Thank you very much!

    Reply
    • October 29, 2016 at 7:40 pm
      Permalink

      Youre welcome!!

      Reply
  • October 13, 2016 at 4:40 am
    Permalink

    First, thanks for providing such detailed guide, I followed till the last point but still missing on adding the address for my JDK bin and openssl, I tried to add “;” before the address just like you mentioned but the address won’t get saved.

    http://i.imgur.com/w5Lirbz.png << Image for the trouble

    Reply
    • October 29, 2016 at 7:41 pm
      Permalink

      Im at a game dev convention showing my new game Save Me from Myself right now, so as soon as I get back Ill sit down and take a look πŸ™‚ Thanks for reading!

      Reply
  • October 13, 2016 at 4:44 am
    Permalink

    Omg, it worked when I delete the semicolon before the address, guess the Win 10 works differently on that, once again thanks for the guide, it helped me out so much ^^7

    Reply
  • October 29, 2016 at 5:15 pm
    Permalink

    Hey Kendra.
    sorry it is not working here.i have tried to do the exact of what you instructed.
    But the error is still coming in unity.I tried uninstalling and installing openssl again and again.but the error keeps on coming.
    Do you have any idea or guess why it is happening?
    Please do let me know.

    Reply
    • October 29, 2016 at 7:39 pm
      Permalink

      Hey there! Im in Columbus for a game dev convention but when I get home this week Ill take a look and try and come up with some ideas. Thanks for reading!

      Reply
    • December 9, 2016 at 4:01 pm
      Permalink

      Glad to help πŸ™‚

      Reply
    • December 9, 2016 at 4:00 pm
      Permalink

      You are welcome 🐰

      Reply
  • January 16, 2017 at 11:34 am
    Permalink

    Helped me, too πŸ™‚

    Reply
    • January 16, 2017 at 1:48 pm
      Permalink

      I’m glad it helped!

      Reply
    • January 23, 2017 at 8:22 am
      Permalink

      Im glad it helped!

      Reply
  • February 14, 2017 at 9:59 pm
    Permalink

    Really helpful!!! You gave me a definite solution!!! Thanks a lot.

    Reply
    • February 14, 2017 at 11:45 pm
      Permalink

      You’re welcome! πŸ˜€

      Reply
  • March 17, 2017 at 9:16 am
    Permalink

    Here i am again nearly after the whole year with another game project now but with the same problem related to OpenSLL πŸ™‚ And let me say you Thanks a lot! once again since your contribution is invaluable! Wish you the greatest projects done, all the best and keep on rocking!

    Reply
  • March 17, 2017 at 2:11 pm
    Permalink

    Omg.. ty! You make me blush πŸ˜„ im glad it helps and if you have any questions, please dont hesitate to ask and i will try my vest to help πŸ˜€

    Reply
  • March 25, 2017 at 2:37 pm
    Permalink

    Best tutorial ever!!! Thank you so much

    Reply
    • March 25, 2017 at 5:13 pm
      Permalink

      Haha πŸ˜€ Thank you. I’m glad you like it

      Reply
  • April 20, 2017 at 6:59 am
    Permalink

    Thank you for saving my time.

    Reply
    • April 21, 2017 at 4:48 pm
      Permalink

      You are welcome πŸ˜€

      Reply
  • April 21, 2017 at 2:28 pm
    Permalink

    thank you solved this shit

    Reply
    • April 21, 2017 at 4:50 pm
      Permalink

      For sure. Shit is smelly. Solving it is good. πŸ’©

      Reply

Leave a Reply

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