diff --git a/source/protocol/http/Makefile.am b/source/protocol/http/Makefile.am index 21ab5382..8c80e44d 100644 --- a/source/protocol/http/Makefile.am +++ b/source/protocol/http/Makefile.am @@ -24,7 +24,7 @@ libhttp_la_SOURCES = curlinterface.c libhttp_la_LDFLAGS = -shared -fPIC -lcurl if IS_LIBRDKCERTSEL_ENABLED libhttp_la_CFLAGS = $(LIBRDKCERTSEL_FLAG) -libhttp_la_LDFLAGS += -lRdkCertSelector +libhttp_la_LDFLAGS += -lRdkCertSelector -lcrypto endif libhttp_la_CPPFLAGS = -fPIC -I${PKG_CONFIG_SYSROOT_DIR}$(includedir)/dbus-1.0 \ -I${PKG_CONFIG_SYSROOT_DIR}$(libdir)/dbus-1.0/include \ diff --git a/source/protocol/http/curlinterface.c b/source/protocol/http/curlinterface.c index 98df178c..a1159596 100644 --- a/source/protocol/http/curlinterface.c +++ b/source/protocol/http/curlinterface.c @@ -31,6 +31,9 @@ #include #include #include +#ifdef LIBRDKCERTSEL_BUILD +#include +#endif #include "curlinterface.h" #include "reportprofiles.h" @@ -319,6 +322,7 @@ T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) rdkcertselectorStatus_t curlGetCertStatus; char *pCertURI = NULL; bool state_red_enable = false; + char *pEngine = NULL; #endif char *pCertFile = NULL; char *pCertPC = NULL; @@ -440,6 +444,9 @@ T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) */ if(childPid == 0) { +#ifdef LIBRDKCERTSEL_BUILD + OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL); +#endif curl = curl_easy_init(); if(curl) { @@ -455,6 +462,23 @@ T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) goto child_cleanReturn; } #ifdef LIBRDKCERTSEL_BUILD + pEngine = rdkcertselector_getEngine(curlCertSelector); + if(pEngine != NULL ) { + code = curl_easy_setopt(curl, CURLOPT_SSLENGINE, pEngine); + if(code != CURLE_OK) { + childCurlResponse.lineNumber = __LINE__; + curl_easy_cleanup(curl); + goto child_cleanReturn; + } + } else { + code = curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1L); + if(code != CURLE_OK ) { + childCurlResponse.lineNumber = __LINE__; + curl_easy_cleanup(curl); + goto child_cleanReturn; + } + } + do { pCertFile = NULL;