LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to use OpenSSL installed in a different dir to compile Links? (https://www.linuxquestions.org/questions/linux-software-2/how-to-use-openssl-installed-in-a-different-dir-to-compile-links-4175607208/)

dedec0 06-02-2017 03:45 PM

How to use OpenSSL installed in a different dir to compile Links?
 
I had a working version of Links browser. It was installed only for my user, in a remote machine where I do *not* have root access. So it is installed in ~/raiz/, a folder who has many subfolders with familiar names: bin, usr, etc, man, share, ... and so on.

But when I tried to access hotmail.com with that Links, it said to me:

Quote:

Error loading https://mail.live.com/[...]
This version of Links does not contain SSL/TLS support
Today, suspecting of a possible problem in Hotmail servers, I tried to use it and this happened. I decided to build links again, but this time with SSL included.

Great: http://links.twibright.com/download.php now is on version 2.14, and the one I already had is 2.3pre1. Downloaded source, configured... but in the end it said this:

Code:

---------------------------------------------------------
Configuration results:

Event handler:                NO
IPv6:                        YES
Supported compression:        ZLIB BZIP2 LZMA
SSL support:                NO
UTF-8 terminal:                YES
GPM support:                NO
Graphics enabled:        NO
---------------------------------------------------------

I want SSL. It was not hard to discover the "--with-ssl" argument to configure. Actually, there are many other options to use: './configure --help' explains them well.

Well, './configure --prefix=/home/me/raiz/ --with-ssl' ended with an error:

Code:

checking for XFree for OS/2... (cached) no
checking for pkg-config... (cached) /usr/bin/pkg-config

checking for openssl... no
checking for OpenSSL... no
configure: error: OpenSSL not found

):

After a bit more time looking around, I decided to download OpenSSL source and install it for my user. Check these comments and commands from my terminal, with some output removed to make it easy to read:

Code:

$ mkdir ~/dev/openssl; cd ~/dev/openssl
$ # Got OpenSSL 1.1.0 (file openssl-1.1.0f.tar.gz) from
$ # https://www.openssl.org/
$ tar xzf openssl-1.1.0f.tar.gz; cd openssl-1.1.0f
$ # OpenSSL has uncommon filenames, I've made no change
$ ./config --prefix=/home/me/raiz
$ make
 # output edited, but it ended well
$ # the README or the INSTALL file talk about 'make test':
$ make test
 # output edited, all tests went well, except a few that
 # were skipped because what they test is not being build
$ make install
 # now OpenSSL is installed in my private root. A *huge*
 # number of files were installed! Many function manuals.
$ # OpenSSL installed, lets get back to links 2.14 dir
$ cd ~/dev/links/links-2.14
$ ./configure --prefix=/home/me/raiz --with-ssl
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal-1.4... missing
 # edited some lines!
checking for resume_thread... (cached) no
checking for MouOpen... (cached) no
checking for _read_kbd... (cached) no
checking for XFree for OS/2... (cached) no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for openssl... no
checking for OpenSSL... no
configure: error: OpenSSL not found
$ # Now, the thread question:

How do I tell links source that OpenSSL is in ~/raiz/ ?

kentyler 06-02-2017 03:51 PM

You would have to compile the openssl source to allow the libraries to be available. Then you would use --with-ssl=/path/to/libs

dedec0 06-02-2017 04:17 PM

Quote:

Originally Posted by kentyler (Post 5718424)
You would have to compile the openssl source to allow the libraries to be available.

I do not understand what you mean. The way I configured and installed it is not doing that? Specifically, aren't the libraries in ~/raiz/lib ? This is what I understand from what is written in INSTALL file (with the main related part from line 689 to 714).

Quote:

Then you would use --with-ssl=/path/to/libs
Trying that now with the path I mentioned in the paragraph above... (: Reporting results in a few minutes.

dedec0 06-02-2017 04:28 PM

With path to --with-ssl option
 
Now I tried to compile Links passing the path to the --with-ssl option. It did not work. See commands with some output below. It changed. As I copied in a previous post, there where 2 lines about OpenSSL. One said about "openssl" and the next was about "OpenSSL". Now it is:

Code:

$ cd ~/dev/links/links-2.14
$ ./configure --prefix=/home/me/raiz/ --with-ssl=/home/me/raiz/lib/
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
 # some lines edited
checking for XFree for OS/2... (cached) no
checking for OpenSSL... no
configure: error: OpenSSL not found
$

Why it did not find it? It is installed there, I think.

kentyler 06-02-2017 04:56 PM

It may look for the include files you may have to try /home/me/raiz/ or /home/me/raiz/include

There should be a log for configure that shows what the problem is, don't always rely on the console output.

dedec0 06-02-2017 05:34 PM

Quote:

Originally Posted by kentyler (Post 5718443)
It may look for the include files you may have to try /home/me/raiz/ or /home/me/raiz/include

Strange. I will try those two (and maybe a few more) paths as the argument for --with-ssl. Should that be documented somewhere in the README or the INSTALL files of Links? Or is it just me too newbie for these things? (:

Quote:

There should be a log for configure that shows what the problem is, don't always rely on the console output.
I did not know that. Thank you! The configure scripts outputs have always been the one and only thing I checked before running make. Lets search that log file...

dedec0 06-02-2017 05:58 PM

Quote:

Originally Posted by kentyler (Post 5718443)
[...] you may have to try /home/me/raiz/ or [...]

I did not yet looked for the configure log. I started just running it again with the two similar paths that you pointed. Can you guess what happened? :D

Look:

Code:

$./configure --prefix=/home/me/raiz --with-ssl=/home/me/raiz/
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
 # a few edited lines
checking for OpenSSL... openssl
checking for openssl/x509v3.h... yes
 # a few edited lines
checking for OPENSSL_init_ssl... yes
checking for SSL_load_error_strings... no
checking for SSL_get_ssl_method... yes
checking for SSLv2_client_method... no
checking for SSLv3_client_method... no
checking for TLSv1_client_method... yes
checking for TLSv1_1_client_method... yes
checking for TLSv1_2_client_method... yes
 # a few edited lines
---------------------------------------------------------
Configuration results:

Event handler:                NO
IPv6:                        YES
Supported compression:        ZLIB BZIP2 LZMA
SSL support:                OPENSSL
UTF-8 terminal:                YES
GPM support:                NO
Graphics enabled:        NO
---------------------------------------------------------
$

A silly note: giving the ~/raiz/include folder to --with-ssl just repeats the problem. The right one is the ~/raiz, the prefix I used to configure OpenSSL build.

It worked! :D As soon as I run links with some SSH page working I will mark this thread as solved.

Many thanks to all that helped me here! Specially to kentyler, who gave the exact tip. (:

A possibly smaller question: note that configure did not find SSL v2 and v3. Is this a possible problem when Links use secure connections to any website?

dedec0 06-02-2017 06:01 PM

Quote:

Originally Posted by kentyler (Post 5718424)
You would have to compile the openssl source to allow the libraries to be available. Then you would use --with-ssl=/path/to/libs

No, no! It seems that the build I did with OpenSSL does that. The only trick was choosing the correct folder to give --with-ssh. See my previous post. (:

dedec0 06-02-2017 07:49 PM

After configure for Links 2.14 ended well, and with SSL enabled, I built it. No problem ocurred, then I installed it in my ~/raiz. It also installed a man page.

By running 'links hotmail.com', something surprised me: links said that mail.live.com (the domain we are initially redirected to) and 'login.live.com' (another domain we are redirected to) do not have valid certificates. I told it to connect anyway, but isn't that something strange? Microsoft is one of the biggest free mail providers of the world! Unfortunately, the site refuses to work without Javascript (Links does not have it).

Links is working with SSL, so this thread is solved (should be, but is not!). The only remaining question is that about SSLv2 and SSLv3 I have made in the post #7:

http://www.linuxquestions.org/questi...8/#post5718466

Again, thank you all very much! (:


All times are GMT -5. The time now is 09:01 PM.