VirtualBox

Changeset 45398 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Apr 8, 2013 9:32:00 AM (12 years ago)
Author:
vboxsync
Message:

Runtime/http: more error codes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/http.cpp

    r45381 r45398  
    3535#include <iprt/string.h>
    3636#include <iprt/file.h>
     37#include <iprt/stream.h>
    3738
    3839#include <curl/curl.h>
     
    9091    CURLcode rcCurl = curl_global_init(CURL_GLOBAL_ALL);
    9192    if (CURL_FAILED(rcCurl))
    92         return VERR_INTERNAL_ERROR;
     93        return VERR_HTTP_INIT_FAILED;
    9394
    9495    CURL *pCurl = curl_easy_init();
    9596    if (!pCurl)
    96         return VERR_INTERNAL_ERROR;
     97        return VERR_HTTP_INIT_FAILED;
    9798
    9899    PRTHTTPINTERNAL pHttpInt = (PRTHTTPINTERNAL)RTMemAllocZ(sizeof(RTHTTPINTERNAL));
     
    237238                    }
    238239                    else
    239                         rc = VERR_INTERNAL_ERROR;
     240                        rc = VERR_HTTP_CACERT_WRONG_FORMAT;
    240241                }
    241242                else
     
    243244            }
    244245            else
    245                 rc = VERR_INTERNAL_ERROR;
     246                rc = VERR_HTTP_CACERT_WRONG_FORMAT;
    246247            X509_free(crt);
    247248        }
    248249        else
    249             rc = VERR_INTERNAL_ERROR;
     250            rc = VERR_HTTP_CACERT_WRONG_FORMAT;
    250251        BIO_free(cert);
    251252    }
     
    334335    else
    335336    {
     337        RTPrintf("rcCurl = %d\n", rcCurl);
    336338        switch (rcCurl)
    337339        {
     
    343345                rc = VERR_HTTP_COULDNT_CONNECT;
    344346                break;
     347            case CURLE_SSL_CONNECT_ERROR:
     348                rc = VERR_HTTP_SSL_CONNECT_ERROR;
     349                break;
     350            case CURLE_SSL_CACERT:
     351                /* The peer certificate cannot be authenticated with the CA certificates
     352                 * set by RTHttpSetCAFile(). We need other or additional CA certificates. */
     353                rc = VERR_HTTP_CACERT_CANNOT_AUTHENTICATE;
     354                break;
     355            case CURLE_SSL_CACERT_BADFILE:
     356                /* CAcert file (see RTHttpSetCAFile()) has wrong format */
     357                rc = VERR_HTTP_CACERT_WRONG_FORMAT;
     358                break;
    345359            default:
    346360                break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette