@@ -26,8 +26,8 @@ using std::string;
2626 #include < fstream>
2727
2828 #if !defined(NO_OPENSSL)
29- #define CERTIFICATE_FILE " ssl/ cacert.pem"
30- #define PRIVATE_KEY_FILE " ssl/ cacert.key"
29+ #define CERTIFICATE_FILE " cacert.pem"
30+ #define PRIVATE_KEY_FILE " cacert.key"
3131 #endif
3232#endif
3333
@@ -318,16 +318,17 @@ ofHttpResponse ofURLFileLoaderImpl::handleRequest(const ofHttpRequest & request)
318318 }
319319 if (version->features & CURL_VERSION_SSL) {
320320#if !defined(NO_OPENSSL)
321- const std::string caPath = " ssl" ;
322- const std::string caFile = " ssl/cacert.pem" ;
323- if (ofFile::doesFileExist (ofToDataPath (CERTIFICATE_FILE)) && checkValidCertifcate (ofToDataPath (CERTIFICATE_FILE))) {
324- ofLogVerbose (" ofURLFileLoader" ) << " SSL valid certificate found" ;
321+ const std::string certPath = ofToDataPath (CERTIFICATE_FILE, true );
322+ if (ofFile::doesFileExist (certPath) && checkValidCertifcate (certPath)) {
323+ ofLogVerbose (" ofURLFileLoader" ) << " SSL valid certificate found at " << certPath;
325324 } else {
326325 ofLogVerbose (" ofURLFileLoader" ) << " SSL certificate not found - generating" ;
327326 createSSLCertificate ();
328327 }
329- curl_easy_setopt (curl.get (), CURLOPT_CAPATH, ofToDataPath (caPath, true ).c_str ());
330- curl_easy_setopt (curl.get (), CURLOPT_CAINFO, ofToDataPath (caFile, true ).c_str ());
328+ curl_easy_setopt (curl.get (), CURLOPT_CAINFO, certPath.c_str ());
329+ #ifndef TARGET_WIN32
330+ curl_easy_setopt (curl.get (), CURLOPT_CAPATH, ofToDataPath (" ./" , true ).c_str ());
331+ #endif
331332#endif
332333 curl_easy_setopt (curl.get (), CURLOPT_SSL_VERIFYPEER, false );
333334 curl_easy_setopt (curl.get (), CURLOPT_SSL_VERIFYHOST, 2L );
0 commit comments