Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix a directory error on Openssl [closed]

Tags:

openssl

When I type in a code I keep getting an error message and I'm not sure how to fix this.

Can't open textFile.txt for reading, No such file or directory
25769902144:error:02001002:system library:fopen:No such file or directory:crypto/bio/bss_file.c:69:fopen('textFile.txt','rb')
25769902144:error:2006D080:BIO routines:BIO_new_file:no such file:crypto/bio/bss_file.c:76:
error in aes-256-ecb

Please help

like image 530
Youngho Kim Avatar asked Aug 09 '20 04:08

Youngho Kim


1 Answers

As the error message says, the cause of the error is that textFile.txt doesn't exists.

I just had a similar error when using openssl ca, so I'm going to assume that's also the command you used. If that is the case, check your OpenSSL CA config file to see what kind of file textFile.txt is supposed to be and create it with appropriate content.

For example the errors I encountered were about about missing index.txt and serial.txt files, with a config similar to this:

[ CA_default ]
database = index.txt
serial   = serial.txt

Simply creating an empty index.txt file and a serial.txt file with a generated serial fixed the issue. Maybe textFile.txt is also a serial file but that's impossible to tell without seeing your config.

like image 164
kapex Avatar answered Oct 16 '22 17:10

kapex