Ошибка openssl fatal

To fix this problem, you have to install OpenSSL development package, which is available in standard repositories of all modern Linux distributions.

To install OpenSSL development package on Debian, Ubuntu or their derivatives:

$ sudo apt-get install libssl-dev

To install OpenSSL development package on Fedora, CentOS or RHEL:

$ sudo yum install openssl-devel 

Edit :
As @isapir has pointed out, for Fedora version>=22 use the DNF package manager :

dnf install openssl-devel

I’m trying to install the mitmproxy package via pip like this:

$ sudo pip install mitmproxy

It terminates with following error message:

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o

build/temp.linux-x86_64-2.7/_openssl.c:391:30: fatal error: openssl/opensslv.h: No such file or directory

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
  Can't roll back cryptography; was not uninstalled
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-jvLTVf/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-DrY4DI-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-jvLTVf/cryptography
Storing debug log for failure in /home/niklas/.pip/pip.log

After this it’s somewhat installed, at least I can uninstall it afterwards.

 $ mitmproxy

leads to

Traceback (most recent call last):
  File "/usr/local/bin/mitmproxy", line 7, in <module>
    from mitmproxy.main import mitmproxy
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/main.py", line 7, in <module>
    from . import version, cmdline
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/cmdline.py", line 6, in <module>
    import configargparse
ImportError: No module named configargparse

If you are developing some native C application based on openssl API’s ( https://www.openssl.org/docs/ ) , you will need to include necessary header at the top of the C program as,

#include <openssl/ssl.h>

Error received while compilation of our C program,

fatal error: openssl/ssl.h: No such file or directory

Solution :

Now, if you use such header and tried to compile on ubuntu, you may see an error like “fatal error: openssl/ssl.h: No such file or directory” . In such case, use below command as solution to install missing development headers dependency for ubuntu.

$ sudo apt-get install libssl-dev

Если я правильно понимаю, решение описано здесь. К сожалению, требуется знание английского:

When the following dependency is installed lib64expat1-dev many packages are replaced, some of which were 64bit specific.

The problem here is that opensslconfig.h has been moved into a different directory as can be seen below:

$ find / -type f -name opensslconf.h
/usr/include/x86_64-linux-gnu/openssl/opensslconf.h

Where as the compiler is searching for this file inside of /usr/include for it. So simply creating a symbolic link will correct this dependency.

$ cd /usr/include/openssl
$ ln -s /usr/include/x86_64-linux-gnu/openssl/opensslconf.h opensslconf.h

В общем, как я и писал в первом пОсте, нужный файл пишется в different directory, в «не ту» папку, и, соответственно, compiler его не находит. Проблема решается созданием symbolic link, которая will correct dependency. Вот только как создать эту символическую ссылку?

I have been installing OpenCA version 1.5.1 on CentOS 7 machine. According to the documentation, I need to install OpenCA tools package before installing OpenCA Base package. However, I get “fatal error openssl err.h – No such file or directory” while compiling OpenCA tools package as shown below.

[root@ra openca-tools-1.3.1]# make
Making all in src/sv
make[1]: Entering directory `/root/downloads/openca-tools-1.3.1/src/sv'
gcc -DHAVE_CONFIG_H -I. -I../../include/openca -I../../include -g -O2 -fstack-check -maccumulate-outgoing-args -MT apps.o -MD -MP -MF .deps/apps.Tpo -c -o apps.o apps.c
apps.c:119:25: fatal error: openssl/err.h: No such file or directory
 #include <openssl/err.h>
 ^
compilation terminated.
make[1]: *** [apps.o] Error 1

How to fix this error?

Solution: Fix fatal error openssl err.h

You might be aware that OpenSSL should be installed before installing OpenCA. In case, if you don’t have OpenSSL installed, then jump to this tutorial and install it first.

Coming back to the error ‘fatal error: openssl/err.h: No such file or directory‘, it seems like the compilation script is not able to find one of the OpenSSL header file. In our case, it’s err.h file.

To find which package provides a particular file or header file, use the below command:

On CentOS, use yum whatprovides as shown below:

[root@ra ]# yum whatprovides '*/openssl/err.h'
1:openssl-devel-1.0.2k-8.el7.i686 : Files for development of applications which will use  OpenSSL
Repo : base
Matched from:
Filename : /usr/include/openssl/err.h

1:openssl-devel-1.0.2k-8.el7.x86_64 : Files for development of applications
 : which will use OpenSSL
Repo : base
Matched from:
Filename : /usr/include/openssl/err.h

1:openssl-devel-1.0.2k-8.el7.x86_64 : Files for development of applications
 : which will use OpenSSL
Repo : @base
Matched from:
Filename : /usr/include/openssl/err.h

Note: You can replace '*/openssl/err.h' with the file you would like to search. For example, you can also simply search for a particular file as '*/err.h'.

On Ubuntu machines, use dpkg command as shown below:

# dpkg -S openssl/err.h
libssl-dev:amd64: /usr/include/openssl/err.h

Alternatively, you can use apt-file find <filename> command as well.

# apt-file find openssl/err.h
libssl-dev: /usr/include/openssl/err.h
libwolfssl-dev: /usr/include/cyassl/openssl/err.h
libwolfssl-dev: /usr/include/wolfssl/openssl/err.h

Well, the above output says that err.h file is shipped with OpenSSL development package. So installing openssl-devel should fix the error.

# yum install openssl-devel

On Ubuntu variants:

# sudo apt-get install libssl-dev

Now, OpenCA tools package should compile without an error. Hope it helps someone out there.

Понравилась статья? Поделить с друзьями:
  • Ошибка openldap при запросе
  • Ошибка openldap при gssapi соединения
  • Ошибка openiv не имеет доступа к выбранной директории
  • Ошибка openid аутентификации пользователя тонкий клиент 1cfresh
  • Ошибка opengl32 dll при запуске игры pubg