openssl command fail on one windows machine in GitBash window while works on another

Viewed 162

This command fails on one Windows machine in git bash session, while on the other machine it work fine.

auser@pc MINGW64 /c/Developer/TEMP/openssltest
$ echo "Hi Alice!" | openssl rsautl -encrypt -inkey /c/Developer/TEMP/openssltest/pub2.pem --pubin
Can't open /c/Developer/TEMP/openssltest/pub2.pem for reading, No such file or directory
15844:error:02001003:system library:fopen:No such process:../openssl-1.1.1k/crypto/bio/bss_file.c:69:fopen('/c/Developer/TEMP/openssltest/pub2.pem','r')
15844:error:2006D080:BIO routines:BIO_new_file:no such file:../openssl-1.1.1k/crypto/bio/bss_file.c:76:
unable to load Public Key

auser@pc 

This command work on a machine where it fails

$ echo "Hi Alice!" | openssl rsautl -encrypt -inkey ./pub2.pem --pubin

I do not have any issues on another machine. Where to look?

1 Answers

I would look into:

  • difference in openssl version
  • read access: cat /c/Developer/TEMP/openssltest/pub2.pem (or cat /c/Developer/TEMP/anyOtherFile)
  • difference in user for the shell session (env|grep -i user)

If you are running that test with a user account which does not have the right to read that TEMP folder, you would get that error.

Related