Could not find header file for OPENSSL

3.8k Views Asked by At

I am trying to install Luasec on Ubuntu terminal, but it just keeps displaying this error to me:

Error: Could not find header file for OPENSSL
   No file openssl/ssl.h in /usr/local/include
   No file openssl.h/ssl.h/ in /usr/include
   No file openssl/ssl.h in /include
You may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command.

When I check OpenSSL version it says its 1.1.1f

enter image description here

So how do I proceed?

4

There are 4 best solutions below

2
Joohane On BEST ANSWER

Fixed the issue by Installing OpenSSL with terminal through Luarocks with the command:

Luarocks install openssl

And now after installing it, it works.

0
anmg On
sudo apt -y install libssl-dev
0
user7057908 On

Despite the lowercase l this solution works for me (independent of what some responders told here)

luarocks install openssl

0
Rahul Gandhi On

I don't think any of the mentioned answers solves the problem. Hence sharing what worked for me.

OS: macOS Ventura

Before running this command, I had lua and openssl (brew install openssl) installed.

What you need to figure out is the path for these two. Start looking them inside /usr/local/Cellular folder and update in below format:

luarocks --lua-dir /usr/local/Cellar/lua/5.4.4_1/ install luasec OPENSSL_DIR=/usr/local/Cellar/[email protected]/1.1.1t

This way we are explicitly telling the command where the required directory are.