Hackney returning error regarding keyfile

Hello,

I’m getting weird error regarding key file settings when doing request using hackney, it is like this
{:error, {:options, {:keyfile, '/cert/key_rsa.pem', []}}}, I know that when keyfile is not accesible, I get something like this {:options, {:keyfile, <path>, {:error, :enoent}}} so, anybody know what error [] during file reading means?

Thank you

[] is the same as an empty charlist '', the string type of erlang. So maybe it can read the file, but there’s no data in it.

We tried empty file and it returned {:ok, ""}, we also tried :file.read_file(...) on running system and it returned that certifikate, so I’m continuing debuging ssl module and maybe find code where keyfile is read. Thank you so far.

I found out that what actually is happening is that in ssl ssl_manager:cache_pem_file(KeyFile, DbHandle) returns [] in:

init_private_key(DbHandle, undefined, KeyFile, Password, _) ->
    try
	{ok, List} = ssl_manager:cache_pem_file(KeyFile, DbHandle),
	[PemEntry] = [PemEntry || PemEntry = {PKey, _ , _} <- List,
				  PKey =:= 'RSAPrivateKey' orelse
				      PKey =:= 'DSAPrivateKey' orelse
				      PKey =:= 'ECPrivateKey' orelse
				      PKey =:= 'PrivateKeyInfo'
		     ],
	private_key(public_key:pem_entry_decode(PemEntry, Password))
    catch 
	_:Reason ->
      erlang:display("ssl config init_private_key error"),
      erlang:display(Reason),
	    file_error(KeyFile, {keyfile, Reason}) 
    end;

so now I know where it is happening but I have no clue how to fix it…

Hey,

Sorry for replying on an old thread, but I am experiencing this exact issue and was wondering if you were ever able to resolve it. I’m struggling to figure out what the issue is since I know my keyfile exists and the data can be read with a File.read. Any help would be much appreciated.