'SSL_ERROR_SYSCALL when using gsoap with openssl 1.1

I am using gsoap (stdsoap2.cpp) for my application to connect to a server. We are using openssl-1.1, so with a minor change in stdsoap2.cpp (replacing M_ASN1_STRING_data with ASN1_STRING_get0_data), the app compiled successfully with openssl-1.1. However, when trying to connect, gsoap gives error :

SOAP 1.1 fault: SOAP-ENV:Client [no subcode]
"SSL_ERROR_SYSCALL
Error observed by underlying SSL/TLS BIO: Success"
Detail: SSL_connect error in tcp_connect()

When investigated, it was found that in gsoap, SSL_connect() returns -1. But when using openssl-1.0, it connects successfully.

What could be the reason ?

Using gsoap version: 2.8.23



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source