3

I've run searches all day without any luck or results. I have built a Centos 7 server and installed Python 3.7 along with OpenSSL 1.1.1.

However, when I run Python and perform the following:

import ssl
ssl.OPENSSL_VERSION

The output I get is OpenSSL 1.0.2k. When running openssl version at the prompt, I get OpenSSL 1.1.1.

Both OpenSSL and Python were compiled on the machine.

The correct OpenSSL is in the path. Also tried to compile Python with the configure --with-openssl=/usr/local (location of the correct openssl).

Thanks.

[Edit]
When I type

openssl version  
sudo openssl version  

I get different versions coming up. The sudo openssl version is the same that I get through Python. $PATH with and without sudo is the same

funnel77
  • 41
  • 3
  • this looks similar, check ==> https://stackoverflow.com/a/46308535/8150371 – Stack Sep 19 '18 at 06:57
  • The instructions there seems to be tailored for Mac OSx. Using Brew. Trying to do the same on Centos 7. Tried what I could from there without any success. – funnel77 Sep 20 '18 at 03:21

1 Answers1

0

When you compile Python, you need to tell it which OpenSSL headers and libraries to use. Try this before running "./configure" when building Python

export CFLAGS="$CFLAGS $(pkg-config --cflags openssl11)"
export LDFLAGS="$LDFLAGS $(pkg-config --libs openssl11)"
gjvc
  • 81
  • 2
  • 3