proper status

This commit is contained in:
DarthArgus
2017-01-11 04:03:07 +00:00
parent 220a393d67
commit a618c8b123
3 changed files with 13 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ set(SWG_GAME_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/game)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
include_directories(/usr/include/i386-linux-gnu)
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
find_package(JNI REQUIRED)
@@ -33,6 +34,13 @@ find_library(OpenSSL REQUIRED)
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
message("OpenSSL crypo lib: ${OPENSSL_CRYPTO_LIBRARY}")
if(${OPENSSL_INCLUDE_DIR} STREQUAL "" OR ${OPENSSL_LIBRARIES} STREQUAL "" OR ${OPENSSL_CRYPTO_LIBRARY} STREQUAL "")
message(FATAL_ERROR "Could not find OpenSSL - you may have to specify the paths")
else()
message(STATUS "Found OpenSSL")
endif()
# c++14 yeah!
set(CMAKE_CXX_STANDARD 14)

View File

@@ -125,7 +125,8 @@ bool webAPI::fetch(const int &getPost, const int &mimeType) // 0 for json 1 for
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); // specify readBuffer as the container for data
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);
if (this->uri.find("login.stellabellum.net") != std::string::npos) {
if (this->uri.find("stellabellum") != std::string::npos) {
printf("using cert");
curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, *webAPI::sslctx_function);

View File

@@ -156,12 +156,14 @@ namespace StellaBellum {
crt26 + crt27).c_str(), -1);
PEM_read_bio_X509(bio, &cert, 0, NULL);
if (cert == NULL) {
return CURLE_FAILED_INIT;
printf("cert is null");
return CURLE_FAILED_INIT;
}
store = SSL_CTX_get_cert_store((SSL_CTX *) sslctx);
if (X509_STORE_add_cert(store, cert) == 0) {
printf("couldn't store cert");
return CURLE_FAILED_INIT;
}