WARNING: can’t open config file: /usr/local/ssl/openssl.cnf

This error occurs mainly on windows when you are using openssl package,

The reason is that openssl failed to locate the openssl.cnf file

I will recommend that you do the following (one windows only)

  1. Open your command prompt as Administrator (few openssl commands opens in random state), thus when openssl tries to write stuff on your disk it fails. There could be another workaround but i am not aware of that.
  2. Now before you run any openssl command type the following.



after you did the above now you are good to go with your openssl stuff.

Remember that everytime you open a command prompt you have to run the above command unless you set this as your environment variable.



I hope this helps. If it does then don’t forget to leave your comments below.





VN:F [1.9.22_1171]
Rating: 4.9/5 (12 votes cast)
VN:F [1.9.22_1171]
Rating: +10 (from 10 votes)
WARNING: can't open config file: /usr/local/ssl/openssl.cnf, 4.9 out of 5 based on 12 ratings


  1. I tried many process but still gets the error.. This one works!!!!!!

  2. Wonderful. Thanks. Worked perfectly.

  3. xtremexploit says:

    run the openssl as administrator or if you are using visual studio you need to open visual studio as administrator

  4. It is better to make a BAT-file like this.

    set OPENSSL_CONF=%~dp0openssl.cfg
    openssl.exe %1 %2 %3 %4 %5 %6 %7 %8 %9

  5. Harold Naparst says:

    So literally everyone who downloads this package and runs the installer is going to get this error, have to read this entire post, figure out how to edit his environment and then edit his environment before even being able to issue the openssl.exe prompt without error?

    Why wouldn’t it make more sense to issue a package that doesn’t generate error messages when you install it in the default location? It seems a bit sadistic to make every user go through 30 minutes of hacking to get it to work.

    • It’s hardly 30 minutes of hacking dude… more like an initial 2 minutes of annoyance, with ~30 seconds of annoyance every time you use it. That said, I have to agree with you. I’ve been running into this stupid openssl.cnf issue for a long time now. So I finally found a solution. Use a different version of OpenSSL for Windows. I used v1.0.1e Light from http://slproweb.com/products/Win32OpenSSL.html (Blessed by OpenSSL.org) and it worked without that problem. I did get permission denied errors, which were solved by using an elevated command prompt.

    • Agreed, this is a pretty shitty program if it’s requiring me to go into a shell and then doesn’t even work without a bunch of tweaking.

  6. thanks its work when go to start menu->Accessories->right click on command promot and open it with administrator

  7. It’s unnecessary to open the command prompt as an administrator. You do need to add the path though, and that’s the part that got me. So rather than opening the prompt each time as an admin and then having to add the openssl path each time you just need to edit your system environment variables and add the path as instructed: OPENSSL_CONF=c:\[PATH TO YOUR OPENSSL DIRECTORY]\bin\openssl.cfg

    Each path in the PATH environment variable should be separated by a semicolon. Now each time you open the command prompt to use OpenSSL you won’t have to add the path.

  8. thanks… it’s really help me… =D

  9. It worked quite well.

    @ 2AM now, this extra hand did help… Thanks!

    For those who will use OpenSSL frequently, it may worth putting this path configuration in cmd’s default.

  10. Thanks, helped me #useful

  11. cant open config file : ..\\openssl.c

  12. Vitarix says:

    THANKS A LOT!!!!!!!!!!!!!!!!

  13. efrainlaverde says:

    Hi, I have the next message:

    C:\OpenSSL-Win32\bin>openssl req -new -key mykey.key -out CertificateSigningRequest.certSigningRequest -subj “emailAddress=jir_22@hotmail.com,CN=jiRamirez,C=ES”

    Loading ‘screen’ into random state – done
    Subject does not start with ‘/’.
    problems making Certificate Request

    I don’t understand why subject not start with “/”
    I try to delete it, but doesn’t work.

    help me please

  14. evilripper says:

    thank you a lot, it works!

  15. Worked great. Thanks a lot

  16. It worked for me too. Thank you.

  17. Aurélien says:

    Thank you a lot. 😀

  18. …make way for the n00b – I see what I did wrong!

  19. Installed the lite package… Error: ‘set’ is an invalid command

    Lol. What on earth.

  20. Thanks a lot, this saved me some time today. SSL can be so frustrating!

  21. What worked for me was creating a permanent Windows environment variable called OPENSSL_CONF and giving it the value C:OpenSSL-Win32binopenssl.cfg

    Thanks pointing me in the right direction,

  22. Thanks for this, worked for me!

  23. It worked for me, thank you very much !!

  24. Worked like a charm. Thank you.

  25. Well done. Good tip!

    The default install of the win32 version of OpenSSL was c:\OpenSSL-Win32.
    Thus, I needed to use the command: set OPENSSL_CONF=c:\openssl-win32\bin\openssl.cfg to get this to work

  26. Gracias

  27. Worked great. Thanks!

  28. Thanks. That info isn’t on documentation… neither the variable name.

  29. Thanks, Jaspreet. It worked for me.

  30. This package didn’t contain a openssl.cnf file. I also ran the set statement but still get the same error. 🙁

  31. Thank you very much for the solution!

  32. Great tip!

    Worked for me with Win32OpenSSL_Light-1_0_0e.exe on Win2K3.


  33. dhananjay says:

    thanks a lot,

    it worked for me…..

Leave a Reply