1

Background:

My last project included a Python script that required sending mails from my local machine. Under this project, I had to set up my computer in order to do so, including configuring some OpenSSL on my machine.

But because I have no knowledge of OpenSSL, and it was my first time working with it, I had no clue on how to work with it. I did some research and got to work. When I am done with that project, and started on my new one I now run into problems with OpenSSL.

I am now working on a Azure Function where I need to recover data from AAD. But even a project that have just been made, can't run due to the following error:

UnableToStart: c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\Azure Storage Emulator\azurite.exe --location "C:\Users\N1MAJT\AppData\Local\.vstools\azurite" --debug "C:\Users\N1MAJT\AppData\Local\.vstools\azurite\debug.log" --skipApiVersionCheck
UnableToStart: OpenSSL configuration error:
UnableToStart: 22544:error:02001005:system library:fopen:Input/output error:C:\Users\runneradmin\AppData\Local\Temp\pkg.3fcc969acc52617e676dcbbb\node\deps\openssl\openssl\crypto\bio\bss_file.c:69:fopen('C:\Users\N1MAJT\Documents\openssl\openssl-1.0.2j-fips-x86_64\OpenSSL\bin','rb')
UnableToStart: 22544:error:2006D002:BIO routines:BIO_new_file:system lib:C:\Users\runneradmin\AppData\Local\Temp\pkg.3fcc969acc52617e676dcbbb\node\deps\openssl\openssl\crypto\bio\bss_file.c:78:
UnableToStart: 22544:error:0E078002:configuration file routines:def_load:system lib:C:\Users\runneradmin\AppData\Local\Temp\pkg.3fcc969acc52617e676dcbbb\node\deps\openssl\openssl\crypto\conf\conf_def.c:170:

I am unsure on how to restore back to the default OpenSSL, and was hoping someone here may have some suggestions on how to work with this issue.

As mentioned, even a project that was just made, can't run due to the error above. So I know that it has something to do locally on my machine, and not the project.

I have reached out to the OpenSSL community on their forum for further assistance, but I may as well do it here.

If anyone has anything that may help, it would be appreciated.

1 Answers1

0
UnableToStart: OpenSSL configuration error: UnableToStart:
22544:error:02001005:system library:fopen:Input/output error:

In order to resolve this error, Try the steps below.

  1. I tried using OpenSSL with git and saved the Location where my openssl exe file exist to my Environment Variables like below:-

enter image description here

OpenSSL command:-

openssl rsa -passin pass:x -``in server.pass.key -out server.key

Output:-

enter image description here

When I ran my Function from the same Command line, It got triggered successfully, Refer below:-

enter image description here

I also started Storage Emulator and ran OpenSSL command it ran successfully:-

enter image description here

  1. Check your openssl cnf file and if there are any changes reset it to the default and make sure it is added as an environment variable. If openssl cnf file does not exist, Re-install your openssl again, Refer below:-

I have referred the answers from this SO thread1 and SOthread2

Find the path to open ssl:-

openssl version -d

enter image description here

enter image description here

Before running your function you can also Set the environment variable via your command line with the code below as mentioned by @BlackPearl in SO thread1 link:-

set OPENSSL_CONF=C:\Program Files\Git\usr\ssl\openssl.cnf

enter image description here

If none of the above alternatives work create your own cnf file and add it in the same directory as your openssl or the ssl directory. Sometimes the OpenSSL conf files required by different services are different, So you can remove the OPENSSL_CONF enviroment variable and use the above SET command before you run your Function or your service, To avoid dependency errors. As mentioned by Er4twXz in this Github issue regarding same error code as yours. Also refer this github issue for more insights.

Additional reference:-

macos - Is it possible to run Azure Function app with SSL locally? - Stack Overflow

SiddheshDesai
  • 3,668
  • 1
  • 2
  • 11