diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index 9ad7f27caea..e3c5848576b 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -3184,6 +3184,24 @@ static void rcheevos_load_raintegration_callback(int result, { struct retro_game_info* info = (struct retro_game_info*)userdata; +#ifndef HAVE_SSL + /* raintegration will provide its own host information. if it provides an SSL host + * and we can't make SSL calls, change it to a non-SSL request and cross our fingers */ + char url[256] = ""; + if (rc_client_achievement_get_image_url(NULL, RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED, url, sizeof(url)) == RC_OK && + strncmp(url, "https://", 8) == 0) + { + char* ptr = &url[7], ch; + url[4] = ':'; + url[5] = '/'; + url[6] = '/'; + while ((ch = ptr[1]) != '/') + *ptr++ = ch; + *ptr = '\0'; + rc_api_set_image_host(url); + } +#endif + rc_client_raintegration_set_event_handler(client, rcheevos_raintegration_event_handler); rcheevos_load(info); diff --git a/deps/rcheevos/src/rapi/rc_api_common.c b/deps/rcheevos/src/rapi/rc_api_common.c index 5835b28014b..407efe55ff4 100644 --- a/deps/rcheevos/src/rapi/rc_api_common.c +++ b/deps/rcheevos/src/rapi/rc_api_common.c @@ -1150,6 +1150,9 @@ static void rc_api_update_host(char** host, const char* hostname) { } void rc_api_set_host(const char* hostname) { + if (hostname && strcmp(hostname, RETROACHIEVEMENTS_HOST) == 0) + hostname = NULL; + rc_api_update_host(&g_host, hostname); if (!hostname) {