Changeset 45331 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Apr 4, 2013 9:37:00 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/http.cpp
r43713 r45331 1 2 1 /* $Id$ */ 3 2 /** @file … … 6 5 7 6 /* 8 * Copyright (C) 2012 Oracle Corporation7 * Copyright (C) 2012-2013 Oracle Corporation 9 8 * 10 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 35 34 #include <iprt/mem.h> 36 35 #include <iprt/string.h> 36 #include <iprt/file.h> 37 37 38 38 #include <curl/curl.h> … … 49 49 long lLastResp; 50 50 struct curl_slist *pHeaders; 51 const char *pcszCAFile; 51 52 } RTHTTPINTERNAL; 52 53 typedef RTHTTPINTERNAL *PRTHTTPINTERNAL; … … 198 199 } 199 200 201 RTR3DECL(int) RTHttpSetCAFile(RTHTTP hHttp, const char *pcszCAFile) 202 { 203 PRTHTTPINTERNAL pHttpInt = hHttp; 204 RTHTTP_VALID_RETURN(pHttpInt); 205 206 pHttpInt->pcszCAFile = pcszCAFile; 207 208 return VINF_SUCCESS; 209 } 210 200 211 RTR3DECL(int) RTHttpGet(RTHTTP hHttp, const char *pcszUrl, char **ppszResponse) 201 212 { … … 213 224 #endif 214 225 215 /* XXX */ 216 rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_CAINFO, "/etc/ssl/certs/ca-certificates.crt"); 217 if (CURL_FAILED(rcCurl)) 218 return VERR_INTERNAL_ERROR; 226 const char *pcszCAFile = "/etc/ssl/certs/ca-certificates.crt"; 227 if (pHttpInt->pcszCAFile) 228 pcszCAFile = pHttpInt->pcszCAFile; 229 if (RTFileExists(pcszCAFile)) 230 { 231 rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_CAINFO, pcszCAFile); 232 if (CURL_FAILED(rcCurl)) 233 return VERR_INTERNAL_ERROR; 234 } 219 235 220 236 RTHTTPMEMCHUNK chunk = { NULL, 0 };
Note:
See TracChangeset
for help on using the changeset viewer.