3

I'm trying to compile the gsoap-onvif project here: https://github.com/xris-hu/gsoap-onvif

I call the make file and it throws some errors. Working on ubuntu 18.10 i solved some of them installing the dependencies: g++, gsoap, libssl-dev. Unfortunately I have an error which I cannot understand:

admin@UbuntuOS:~/Desktop/gsoap-onvif-master$ make
g++ -c -Wall -g -w -fPIC -DWITH_NONAMESPACES -fno-use-cxa-atexit -fexceptions -DWITH_DOM  -DWITH_OPENSSL -DSOAP_DEBUG   -I./include -I. stdsoap2.cpp -o stdsoap2.o
stdsoap2.cpp: In function ‘int tcp_connect(soap*, const char*, const char*, int)’:
stdsoap2.cpp:4406:52: error: ‘M_ASN1_STRING_data’ was not declared in this scope
             { if (!soap_tag_cmp(host, (const char*)M_ASN1_STRING_data(name)))
                                                    ^~~~~~~~~~~~~~~~~~
stdsoap2.cpp:4406:52: note: suggested alternative: ‘ASN1_STRING_data’
             { if (!soap_tag_cmp(host, (const char*)M_ASN1_STRING_data(name)))
                                                    ^~~~~~~~~~~~~~~~~~
                                                    ASN1_STRING_data
make: *** [Makefile:22: stdsoap2.o] Error 1

Someone know how to solve this issue?

UPDATE: the version of gSOAP used in this project is pretty old and may not work with newer versions of OpenSSL. The project could be dead... Anyone knows an alternative?

ALTERNATIVE: Here is the best solution I found: https://github.com/suresecure/onvifcpplib This lib is used also in https://sourceforge.net/projects/onvifmanager/

Jonny
  • 85
  • 1
  • 7

4 Answers4

2

It seams it is a OpenSSL/gsoap isseus, try to update the software with a new version of stdsoap2.cpp.

https://github.com/Sufi-Al-Hussaini/onvif-gsoap-by-example/issues/1

DAme
  • 697
  • 8
  • 21
  • UPDATE: the version of gSOAP used in this project is pretty old and may not work with newer versions of OpenSSL. – Jonny Mar 29 '19 at 11:48
0

In Python a very nice solution is the following project on GitHub:

https://github.com/FalkTannhaeuser/python-onvif-zeep

an alternative for python 2.x is:

https://github.com/quatanium/python-onvif.

Jonny
  • 85
  • 1
  • 7
0

Here is a patch that I've successfully used, which is based on newer gSOAP 2.8 versions that use the following source code:

#if OPENSSL_VERSION_NUMBER < 0x10100000L
              const char *tmp = (const char*)ASN1_STRING_data(name);
#else
              const char *tmp = (const char*)ASN1_STRING_get0_data(name);
#endif
              if (!soap_tag_cmp(host, tmp))
              {
                ok = 1;
                DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate subject %s\n", host, tmp));
              }

This patch works with older gSOAP versions.

This edit is made to stdsoap2.c and stdsoap2.cpp in function tcp_connect(), which is pretty long.

Dr. Alex RE
  • 1,772
  • 1
  • 15
  • 23
0

It's the libssl1.0 library problem

Go to this link, find an answer from username saberprashant, and follow his steps. The problem might be solved.

Khanh Tran
  • 87
  • 1
  • 3
  • 9