Unable to create certificate and key for Android on Windows


I cant create certificates in .pem-format and keys in .pk8-format with openssl (using windows btw)


Why can’t you create the key and cert? What happens? What kind of error are you getting?


I followed this manual https://www.defold.com/manuals/android/


btw on another question how can I make my game horizontal for mobile?


Looks like a permission issue. Try to run cmd.exe as administrator.

I think there’s a small bug for Android build at the moment, where you need to manually enter the values for height and width in game.project - even if they are the same as default. (Then re-save it)


I ran cmd as admin this time


I would try to search StackOverflow for the error message about config file. There’s a few solutions there, that may or may not work.


try this for req line

openssl req -new -key key.pem -out request.pem -config C:\openssl\ssl\openssl.cnf

after -config, you should path it correctly to openssl.cnf file in your own directory


tried that but instead of searching for D:\OpenSSL\bin\openssl.cnf its searching for C:/OpenSSL/openssl.cnf


also tried your way didnt work either


btw my horizontal game I meant something like the left picture


If it’s ignoring the -config flag then you could alternatively type this in OpennSSL prompt before generating cert, to set the location.

SET OPENSSL_CONF=D:\OpenSSL\bin\openssl.cnf

Make sure the openssl.cnf file is in whatever path you specify.

New projects are like that by default, but there’s currently an issue with them(and Android) if you don’t manually edit and save the game.project file, here:


dis that SET OPENSSL_CONF=D:\OpenSSL\bin\openssl.cnf but its still saying that WARNING: can’t open config file: C:/OpenSSL/openssl.cnf


and alright you already answered about the android question thanks


Hmm. I am running out of ideas :laughing: (aside from launching a Linux virtualbox)
Maybe try defining the file as .cfg instead of .cnf?

SET OPENSSL_CONF=D:\OpenSSL\bin\openssl.cfg

Also, which Windows version of OpenSSH are you using? (There aren’t any official Windows binaries)
Have you tried with Cygwin maybe?

No problem mate! Hope to see you making games soon!




it looks like its working for the third time I used

SET OPENSSL_CONF=D:\OpenSSL\bin\openssl.cnf



In your screenshot it was typed in the wrong prompt. It should be in the OpenSSL prompt, which you must’ve done :smiley:

OpenSSL> SET OPENSSL_CONF=D:\OpenSSL\bin\openssl.cnf