question

Upvote
Accepted
15 1 1 2

CentOS7 C++ Cons113 Unable to load CURL

I use C++ version of EMA on Windows and CentOS 6.7 work fine. I am trying to use it on CentOS 7 but it always display error

Exception Type='OmmInvalidUsageException', Text='Failed to add RsslChannel(s) to RsslReactor. Channel name(s) Channel_4
        Instance Name Consumer_4_1
        RsslReactor 0x0x2a34b70
        RsslChannel 0
        Error Id -1
        Internal sysError 0
        Error Location /home/centos/rtsdk/Real-Time-SDK/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:1351
        Error Text Failed to initialize RsslRestClient. Text: </home/centos/rtsdk/Real-Time-SDK/Cpp-C/Eta/Impl/Transport/rsslSocketTransportImpl.c:547> Error: 0012 Unable to load CURL.', ErrorCode='-1'

The curl is verion 7.29 on CentOS7. Please advise if any solution on it. Thanks.

ema-apicentos
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @Alvin.Cho

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

Upvotes
Accepted
78.8k 250 52 74

@Alvin.Cho

I just set the LD_LIBRARY_PATH environment variable.

[root@1e537192d113 Optimized]# env
HOSTNAME=1e537192d113
TERM=xterm
OLDPWD=/opt/openssl/bin
LD_LIBRARY_PATH=/opt/refinitiv/Real-Time-SDK/Cpp-C/Ema/Executables/CENTOS7_64_GCC485/Optimized
LS_COLORS=
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/opt/refinitiv/Real-Time-SDK/Cpp-C/Ema/Executables/CENTOS7_64_GCC485/Optimized
SHLVL=1
HOME=/root
LESSOPEN=||/usr/bin/lesspipe.sh %s
_=/usr/bin/env

You can test it with the OpenSSL command. Run the "openssl version -a" command.

[root@1e537192d113 bin]# ./openssl version -a
OpenSSL 1.1.1n  15 Mar 2022
built on: Mon Sep 12 07:45:50 2022 UTC
platform: linux-x86_64
options:  bn(64,64) rc4(16x,int) des(int) idea(int) blowfish(ptr)
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG
OPENSSLDIR: "/usr/local/ssl"
ENGINESDIR: "/opt/openssl/lib/engines-1.1"
Seeding source: os-specific

Then, test the connection to the server. For example:

./openssl s_client -connect us-east-1-aws-1-med.optimized-pricing-api.refinitiv.net:443
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

My OPENSSLDIR is /usr/local/openssl/ssl. I copied cert.pem to this folder and it works. Thanks.

Upvotes
78.8k 250 52 74

@Alvin.Cho

The error message indicates that it is unable to find the curl library.

 Error: 0012 Unable to load CURL 

You can find the curl library in the RTSDK package. It is in the installdb/OL7_64_GCC482/Optimized/lib64 dictionary. You need to set the LD_LIBRARY_PATH environment variable to that location. For example:

export LD_LIBRARY_PATH=/opt/refinitiv/Real-Time-SDK/installdb/OL7_64_GCC482/Optimized/lib64
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @Alvin.Cho

You can find the step-by-step guide in the "Use the Libraries with Refinitiv Real-Time SDK C/C++" section of the How to Build OpenSSL, zlib, and cURL Libraries on Linux article.

Hope this helps.

I think I follow all the procedures and did at least 3 times. Another user also tried it and got the same result. Is there anything I can check?

I can't find any folder named installdb. The most similar one is in in build directory/install/lib64. I pointed LD_LIBRARY_PATH here but still get the same error.

1662702373730.png


1662702373730.png (34.1 KiB)

@Alvin.Cho

What is the version of RTSDK that you are using?

Are you using the official RTSDK package at https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-cc/downloads?

No, I git clone it yesterday
Upvotes
78.8k 250 52 74

@Alvin.Cho

I got the same error when running without the LD_LIBRARY_PATH.

Exception Type='OmmInvalidUsageException', Text='Failed to add RsslChannel(s) to RsslReactor. Channel name(s) Channel_4
        Instance Name Consumer_4_1
        RsslReactor 0x0x15ba120
        RsslChannel 0
        Error Id -1
        Internal sysError 0
        Error Location /opt/refinitiv/Real-Time-SDK/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:1351
        Error Text Failed to initialize RsslRestClient. Text: </opt/refinitiv/Real-Time-SDK/Cpp-C/Eta/Impl/Transport/rsslSocketTransportImpl.c:547> Error: 0012 Unable to load CURL.', ErrorCode='-1'

After setting the LD_LIBRARY_PATH, I can run it properly.

export LD_LIBRARY_PATH=/opt/refinitiv/Real-Time-SDK/rtsdk/install/lib64

Please make sure that the version of libcurl is 7.78.0.

[root@1e537192d113 Optimized]# strings /opt/refinitiv/Real-Time-SDK/rtsdk/install/lib64/libcurl.so | grep libcurl
libcurl.so
...
libcurl/7.78.0
libcurl is now using a weak random seed!


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Yes I aware of that. But the latest version of CentOS7 supported is 7.29. Does it mean we can't use CentOS 7?

1662715845814.png

1662715845814.png (200.9 KiB)
@Alvin.Cho

RTSDK supports CentOS 7. However, you need a new version of libcurl library.

If you run CMake to build the RTSDK package, it will build the libcurl library for you.


@Alvin.Cho

Otherwise, you can download the RTSDK package from https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-cc/downloads. The package contains the libcurl library.

1662717135566.png

1662717135566.png (29.3 KiB)

I downloaded the package ans point LD_LIBRARY_PATH under installdb/OL7_64_GCC482. It seems curl works fine but got an error message as following:

    TimeStamp: 03:12:59.949
    ClientName: ChannelCallbackClient
    Severity: Warning
    Text:    Received ChannelDownReconnecting event on channel Channel_4
        Instance Name Consumer_4_1
        RsslReactor 0x0x16de550
        RsslChannel 0x0x16de550
        Error Id -1
        Internal sysError 0
        Error Location /local/jenkins/workspace/ESDKCore_RCDEV/OS/OL7-64/rcdev/source/rtsdk/Cpp-C/Eta/Impl/Reactor/rsslReactorWorker.c:1973
        Error Text </local/jenkins/workspace/ESDKCore_RCDEV/OS/OL7-64/rcdev/source/rtsdk/Cpp-C/Eta/Impl/Transport/ripcsslutils.c:1188> Error: 2002 Certificate validation error.  OpenSSL Return code: self signed certificate in certificate chain
loggerMsgEnd

I checked old forum post but no idea how to resolve it. Please help. Thanks.

Show more comments
Upvotes
78.8k 250 52 74

@Alvin.Cho

I followed the steps mentioned in the How to Build OpenSSL, zlib, and cURL Libraries on Linux article to build the OpenSSL library.

The library was built with the following options.

./config --prefix=/opt/openssl --openssldir=/usr/local/ssl 

The /usr/local/ssl is the directory for OpenSSL configuration files, and also the default certificate and key store.

If I ran the EMA example without copying the certificate file (cert.pem) to the /usr/local/ssl directory, I got the following error.

loggerMsg
    TimeStamp: 08:18:50.222
    ClientName: ChannelCallbackClient
    Severity: Warning
    Text:    Received ChannelDownReconnecting event on channel Channel_4
        Instance Name Consumer_4_1
        RsslReactor 0x0x1e96120
        RsslChannel 0x0x1e96120
        Error Id -1
        Internal sysError 0
        Error Location /opt/refinitiv/Real-Time-SDK/Cpp-C/Eta/Impl/Reactor/rsslReactorWorker.c:1973
        Error Text </opt/refinitiv/Real-Time-SDK/Cpp-C/Eta/Impl/Transport/ripcsslutils.c:1188> Error: 2002 Certificate validation error.  OpenSSL Return code: self signed certificate in certificate chain
loggerMsgEnd

However, if I copy the certificate file (cert.pem) to the /usr/local/ssl directory, the example can run properly.

ln -s /etc/pki/tls/cert.pem /usr/local/ssl/cert.pem

Therefore, you need to check the location of the default certificate and key store used by the OpenSSL library. Then, make sure that the certificate file is in that directory.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

There is a link already there, and after I recreated the link it still displayed the same error. Can you show me all the exported variables ?

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.