Building websocket example with ssl

41 views
Skip to first unread message

Anders Persson

unread,
Aug 24, 2018, 10:21:06 AM8/24/18
to Eiffel Web Framework
I am buidling target websocket_app_ssl at Ubuntu 16.04. 

First I got two link errors not finding crypto and ssl libraries

I have these to at my computer:

/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 
/lib/x86_64-linux-gnu/libssl.so.1.0.0

Adding the first resolved the crypto but when adding the ssl library I got these errors:

C3/Cobj3.o: I funktionen inline_F81_1274”:
big_file_C3_c
.c:(.text+0x229d5): odefinierad referens till OPENSSL_init_ssl
C3
/Cobj3.o: I funktionen F81_1273”:
(.text+0x26a60): odefinierad referens till OPENSSL_init_ssl
C3
/Cobj3.o: I funktionen F81_1275”:
(.text+0x26fea): odefinierad referens till OPENSSL_init_ssl
C3
/Cobj3.o: I funktionen F81_1276”:
(.text+0x272b4): odefinierad referens till OPENSSL_init_crypto
C3
/Cobj3.o: I funktionen F81_1277”:
(.text+0x2757e): odefinierad referens till OPENSSL_init_crypto
collect2
: error: ld returned 1 exit status


Which version of openssl  do I need? Have I used the wrong libraries?

I have this:

openssl version
OpenSSL 1.0.2g  1 Mar 2016




javier hector

unread,
Aug 24, 2018, 10:23:37 AM8/24/18
to eiffel-web...@googlegroups.com
The supported version is OpenSSL version 1.1.0f.

/Javier

--
--
You received this message because you are subscribed to the Google
Groups "Eiffel Web Framework" group.
 
To post to this group, send email to
eiffel-web...@googlegroups.com
To unsubscribe from this group, send email to
eiffel-web-frame...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

javier hector

unread,
Aug 24, 2018, 10:24:27 AM8/24/18
to eiffel-web...@googlegroups.com
Check the Readme file about how to install it on Ubuntu.

Anders Persson

unread,
Aug 31, 2018, 7:40:20 AM8/31/18
to Eiffel Web Framework
Thanks

I used this readme file to solve the pproblem:


However, I installed version  1.1.0g as descibed in the readme file.

For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-framework+unsub...@googlegroups.com.

Anders Persson

unread,
Mar 11, 2019, 8:42:57 AM3/11/19
to Eiffel Web Framework
Hi

I got this linking problem back.It is the same computer and I have not done any large upgrades of it. Might be that some Ubuntu automatic updates has made it fail again. However, I started to go through the process in the readme file again but it fails when doing "make". I get this error:

/usr/bin/ld: test/sanitytest.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile.shared:179: recipe for target 'link_app.gnu' failed
make[2]: *** [link_app.gnu] Error 1
make[2]: Leaving directory '/home/anders/openssl-1.1.0g'
Makefile:8875: recipe for target 'test/sanitytest' failed
make[1]: *** [test/sanitytest] Error 2
make[1]: Leaving directory '/home/anders/openssl-1.1.0g'
Makefile:130: recipe for target 'all' failed
make: *** [all] Error 2

Any clue about this?

Regards

Anders

Alexander Kogtenkov

unread,
Mar 11, 2019, 10:05:06 AM3/11/19
to eiffel-web...@googlegroups.com
Some object modules have been compiled without the option -fPIC (or -fPIE). E.g., if `sanitytest` is an external module, compilation options could be checked for it.

(Alternatively, you can remove the linker option `-pie`, but it would make the resulting executable less relocatable.)

Alexander Kogtenkov


Anders Persson <ander...@gmail.com>:

Anders Persson

unread,
Mar 11, 2019, 10:20:44 AM3/11/19
to eiffel-web...@googlegroups.com
Hi

sanitytest is an external module. Nothing I have added. I have not changed anything, I just tried to re-make something that was building earlier, but of course things that openSSL depends on can have been updated.

Vänligen

Anders Persson
+46 763 17 23 25



--
--
You received this message because you are subscribed to the Google
Groups "Eiffel Web Framework" group.
 
To post to this group, send email to
eiffel-web...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.

Anders Persson

unread,
Mar 11, 2019, 11:42:31 AM3/11/19
to Eiffel Web Framework
Hi again

I executed "make clean" and was then able to build openSSL again and do the steps in the README file, but I still get the undefined references to "OPENSSL....."

C15/Cobj15.o: I funktionen ”F1505_15513”:
(.text+0x4857): varning: the use of `tempnam' is dangerous, better use `mkstemp'
C5/Cobj5.o: I funktionen ”F236_5177”:
(.text+0x1e): odefinierad referens till ”OPENSSL_init_ssl”
C5/Cobj5.o: I funktionen ”F236_5181”:
(.text+0x4e): odefinierad referens till ”OPENSSL_init_crypto”
C5/Cobj5.o: I funktionen ”F236_5172”:
(.text+0x57c5): odefinierad referens till ”OPENSSL_init_ssl”
(.text+0x57ce): odefinierad referens till ”OPENSSL_init_ssl”
(.text+0x57da): odefinierad referens till ”OPENSSL_init_crypto”
C5/Cobj5.o: I funktionen ”F236_5178”:
(.text+0x5ecb): odefinierad referens till ”OPENSSL_init_ssl”
C5/Cobj5.o: I funktionen ”F236_5179”:
(.text+0x5eeb): odefinierad referens till ”OPENSSL_init_ssl”
C5/Cobj5.o: I funktionen ”F236_5180”:
(.text+0x5f0e): odefinierad referens till ”OPENSSL_init_crypto”
collect2: error: ld returned 1 exit status
Makefile:243: recipe for target 'websocket_app' failed
make: *** [websocket_app] Error 1



Regards

Anders

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-framework+unsub...@googlegroups.com.

Anders Persson

unread,
Mar 12, 2019, 4:46:44 AM3/12/19
to Eiffel Web Framework
Hi

I have gone through these steps in the readme-file (except I am using the "g" version. Do I need to do something more? I am not sure if any of the other steps in the readme-file is necessary to do at Ubuntu.

#How to use the latest OpenSSL 1.1.1a on Ubuntu
================================================

```bash
$>wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
$>tar xzvf openssl-1.1.1a.tar.gz
$>cd openssl-1.1.1a
$>./config -Wl,--enable-new-dtags,-rpath,`$(LIBRPATH)`
$>make
$>sudo make install

$>openssl version -a    

$>echo	If you have an already installed OpenSSL library remove it using

$>sudo apt-get remove libssl-dev
```

Rebuild the ldconfig cache using

```
$sudo ldconfig
```

JV

unread,
Mar 13, 2019, 7:24:19 AM3/13/19
to Eiffel Web Framework
Hi Anders, 

Can you let me know which EiffelStudio version are you using?

/Javier

Anders Persson

unread,
Mar 13, 2019, 7:45:12 AM3/13/19
to Eiffel Web Framework
Hi

Installation information:
Version = EiffelStudio 18.11 (18.11.10.2592 Enterprise Edition - linux-x86-64)
$ISE_EIFFEL = /home/anders/Eiffel_18.11
$ISE_LIBRARY = /home/anders/Eiffel_18.11
$ISE_PLATFORM = linux-x86-64

Ubuntu 18.04.2 LTS

 openssl version -a

OpenSSL 1.1.0g  2 Nov 2017
built on: reproducible build, date unspecified
platform: linux-x86_64
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\""  -Wa,--noexecstack
OPENSSLDIR: "/usr/local/ssl"
ENGINESDIR: "/usr/local/lib/engines-1.1"

target is: websocket_app_ssl

and this is the ecf file

<?xml version="1.0" encoding="ISO-8859-1"?>
<target name="websocket_app">
<root class="APPLICATION_TODO" feature="make_and_launch"/>
<file_rule>
<exclude>/CVS$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option warning="true" manifest_array_type="mismatch_warning">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
<warning name="obsolete_feature" enabled="false"/>
</option>
<setting name="console_application" value="true"/>
<capability>
<catcall_detection support="none"/>
<concurrency support="scoop" use="scoop"/>
<void_safety support="transitional" use="transitional"/>
</capability>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="cypress_consumer" location="$ISE_LIBRARY\contrib\library\web\authentication\oauth\cypress\consumer.ecf"/>
<library name="html" location="\home\anders\github_eiffel_liraries\html\html.ecf"/>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http.ecf"/>
<library name="http_client" location="$ISE_LIBRARY\contrib\library\network\http_client\http_client.ecf"/>
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json.ecf"/>
<library name="json_ext" location="\home\anders\github_eiffel_liraries\json_ext\json_ext.ecf" readonly="false"/>
<library name="net_ssl" location="$ISE_LIBRARY\unstable\library\network\socket\netssl\net_ssl.ecf"/>
<library name="standalone_websocket_connector" location="\home\anders\Eiffel_18.11\contrib\library\web\framework\ewf\wsf\connector\standalone_websocket-safe.ecf" readonly="false"/>
<library name="testing" location="$ISE_LIBRARY\library\testing\testing.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="wsf" location="\home\anders\Eiffel_18.11\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/>
<cluster name="app" location=".\">
<tests name="unit_tests" location="\home\anders\git-repositories\Wunderlistreplacement\unit_tests\">
<uses group="app"/>
<uses group="base"/>
<uses group="testing"/>
<uses group="unit_tests"/>
<uses group="wsf"/>
</tests>
</cluster>
</target>
<target name="websocket_app_st" extends="websocket_app">
<description>Single thread solution. 
Warning: as it can not handle concurrent request, it is recommended to set Keep-Alive-Timeout to very low value, as browser will keep persistent connection open too long.</description>
<capability>
<concurrency support="scoop" use="none"/>
</capability>
</target>
<target name="websocket_app_ssl" extends="websocket_app">
<capability>
<catcall_detection support="none"/>
<concurrency support="scoop"/>
<void_safety support="transitional"/>
</capability>
<variable name="ssl_enabled" value="true"/>
</target>
</system>

JV

unread,
Mar 14, 2019, 8:51:35 AM3/14/19
to Eiffel Web Framework
Hi Anders, I've checked and everything looks good.
But now 18.04 provide the openssl package (https://packages.ubuntu.com/bionic/openssl)

So first check if you can find it
> apt-cache search libssl

Then, check if the package was installed

> tail /var/log/dpkg.log

Finally check the following and let me know what do you get?

>pkg-config --cflags openssl
>pkg-config --libs openssl

/Javier

Anders Persson

unread,
Mar 14, 2019, 9:06:35 AM3/14/19
to eiffel-web...@googlegroups.com
On Thu, 14 Mar 2019 at 13:51, JV <javier...@gmail.com> wrote:
Hi Anders, I've checked and everything looks good.
But now 18.04 provide the openssl package (https://packages.ubuntu.com/bionic/openssl)

So first check if you can find it
> apt-cache search libssl

libssl-dev - Secure Sockets Layer toolkit - development files
libssl-doc - Secure Sockets Layer toolkit - development documentation
libssl1.0-dev - Secure Sockets Layer toolkit - development files
libssl1.0.0 - Secure Sockets Layer toolkit - shared libraries
libssl1.1 - Secure Sockets Layer toolkit - shared libraries
perl-openssl-defaults - version compatibility baseline for Perl OpenSSL packages
dcmtk - OFFIS DICOM toolkit command line utilities
libdcmtk-dev - OFFIS DICOM toolkit development libraries and headers
libdcmtk12 - OFFIS DICOM toolkit runtime libraries
cl-plus-ssl - Common Lisp interface to OpenSSL
dlang-openssl - D version of the C headers for openssl
libssl-ocaml - OCaml bindings for OpenSSL (runtime)
libssl-ocaml-dev - OCaml bindings for OpenSSL
libssl-utils-clojure - library for SSL certificate management on the JVM
r-cran-openssl - GNU R toolkit for encryption, signatures and certificates based on OpenSSL


 

Then, check if the package was installed

> tail /var/log/dpkg.log


2019-03-14 06:30:49 status unpacked libtiff5:amd64 4.0.9-5ubuntu0.2
2019-03-14 06:30:49 status half-configured libtiff5:amd64 4.0.9-5ubuntu0.2
2019-03-14 06:30:49 status installed libtiff5:amd64 4.0.9-5ubuntu0.2
2019-03-14 06:30:49 configure libtiff5:i386 4.0.9-5ubuntu0.2 <ingen>
2019-03-14 06:30:49 status unpacked libtiff5:i386 4.0.9-5ubuntu0.2
2019-03-14 06:30:49 status half-configured libtiff5:i386 4.0.9-5ubuntu0.2
2019-03-14 06:30:49 status installed libtiff5:i386 4.0.9-5ubuntu0.2
2019-03-14 06:30:49 trigproc libc-bin:amd64 2.27-3ubuntu1 <ingen>
2019-03-14 06:30:49 status half-configured libc-bin:amd64 2.27-3ubuntu1
2019-03-14 06:30:49 status installed libc-bin:amd64 2.27-3ubuntu1

 
Finally check the following and let me know what do you get?

>pkg-config --cflags openssl

-I/usr/local/include

 
>pkg-config --libs openssl

-L/usr/local/lib -lssl -lcrypto

 
Hi


For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
You received this message because you are subscribed to the Google
Groups "Eiffel Web Framework" group.
 
To post to this group, send email to
eiffel-web...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages