cpr-example icon indicating copy to clipboard operation
cpr-example copied to clipboard

HTTPS uses in Linux

Open ravikasyap1717 opened this issue 9 years ago • 1 comments

Hello, I try this library with http resquest in linux.it works. But not support for HTTPS in linux.when i try with HTTPS,it gives status_code is 0.

So,Please let me know how can use HTTPS .

Thanks!

ravikasyap1717 avatar May 17 '16 12:05 ravikasyap1717

Same here. Ubuntu 16.04. It does not work when https is used.

However I found is that by default, cpr uses its own curl library, instead of the system ones. So making cpr using system curl library, fixed the problem for me.

In my top level I set SET(USE_SYSTEM_CURL 1), for example

cmake_minimum_required(VERSION 3.5)
project(cpr_test)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(SOURCE_FILES main.cpp)

SET(USE_SYSTEM_CURL 1)

add_executable(jsonrpc_test ${SOURCE_FILES})

add_subdirectory(ext/cpr)

include_directories(${CPR_INCLUDE_DIRS})


target_link_libraries(cpr_test
        ${CPR_LIBRARIES})

moneroexamples avatar Jun 02 '16 01:06 moneroexamples