disable HTTPS cert verification only if building with SSL

This commit is contained in:
Struma 2021-02-24 06:27:39 -05:00 committed by Roza
parent ced6daede7
commit 90d5dda8fb
2 changed files with 7 additions and 1 deletions

View file

@ -3250,6 +3250,7 @@
"MKXPZ_VERSION=\"$(MARKETING_VERSION)\"",
MKXPZ_MINIFFI,
MKXPZ_DEBUG,
MKXPZ_SSL,
AL_LIBTYPE_STATIC,
GLES2_HEADER,
"$(MKXPZ_EXTRA_ARGS)",
@ -3320,6 +3321,7 @@
"MKXPZ_ALCDEVICE=ALCdevice",
"MKXPZ_VERSION=\"$(MARKETING_VERSION)\"",
MKXPZ_MINIFFI,
MKXPZ_SSL,
AL_LIBTYPE_STATIC,
GLES2_HEADER,
"$(MKXPZ_EXTRA_ARGS)",

View file

@ -7,7 +7,7 @@
#include <stdio.h>
#if defined(MKXPZ_SSL) || defined(MKXPZ_BUILD_XCODE)
#if defined(MKXPZ_SSL)
#define CPPHTTPLIB_OPENSSL_SUPPORT
#endif
#include "httplib.h"
@ -116,7 +116,9 @@ HTTPResponse HTTPRequest::get() {
httplib::Headers head;
// Seems to need to be disabled for now, at least on macOS
#ifdef MKXPZ_SSL
client.enable_server_certificate_verification(false);
#endif
for (auto const h : _headers)
head.emplace(h.first, h.second);
@ -146,7 +148,9 @@ HTTPResponse HTTPRequest::post(StringMap &postData) {
httplib::Params params;
// Seems to need to be disabled for now, at least on macOS
#ifdef MKXPZ_SSL
client.enable_server_certificate_verification(false);
#endif
for (auto const h : _headers)
head.emplace(h.first, h.second);