VirtualBox

Changeset 88124 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 15, 2021 5:46:52 PM (4 years ago)
Author:
vboxsync
Message:

OCI/PCA: bugref:9969 - Make it possible to specify the CA file for the
REST API calls. If "cert_bundle" profile parameter is not empty, use it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientApiBase.cpp

    r87004 r88124  
    6363
    6464
     65int RTCRestClientApiBase::setCAFile(const char *pcszCAFile) RT_NOEXCEPT
     66{
     67    return m_strCAFile.assignNoThrow(pcszCAFile);
     68}
     69
     70
     71int RTCRestClientApiBase::setCAFile(const RTCString &strCAFile) RT_NOEXCEPT
     72{
     73    return m_strCAFile.assignNoThrow(strCAFile);
     74}
     75
     76
    6577const char *RTCRestClientApiBase::getServerUrl(void) const RT_NOEXCEPT
    6678{
     
    179191
    180192    int rc = RTHttpCreate(&m_hHttp);
    181     if (RT_FAILURE(rc))
     193    if (RT_SUCCESS(rc) && m_strCAFile.isNotEmpty())
     194        rc = RTHttpSetCAFile(m_hHttp, m_strCAFile.c_str());
     195
     196    if (RT_FAILURE(rc) && m_hHttp != NIL_RTHTTP)
     197    {
     198        RTHttpDestroy(m_hHttp);
    182199        m_hHttp = NIL_RTHTTP;
     200    }
    183201    return rc;
    184202}
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