src/tool_operate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tool_operate.c b/src/tool_operate.c index 2309495d8..2c494e63f 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -3017,11 +3017,15 @@ static CURLcode cacertpaths(struct OperationConfig *config) #ifdef _WIN32 if(!env) { #if defined(CURL_CA_SEARCH_SAFE) - char *cacert = NULL; - FILE *cafile = Curl_execpath("curl-ca-bundle.crt", &cacert); + TCHAR *cacert = NULL; + FILE *cafile = Curl_execpath(TEXT("curl-ca-bundle.crt"), &cacert); if(cafile) { fclose(cafile); +#ifdef UNICODE + config->cacert = curlx_convert_wchar_to_UTF8(cacert); +#else config->cacert = strdup(cacert); +#endif } #elif !defined(CURL_WINDOWS_UWP) && !defined(CURL_DISABLE_CA_SEARCH) result = FindWin32CACert(config, TEXT("curl-ca-bundle.crt"));