Mercurial > hg > orthanc-wsi
diff Framework/Orthanc/Core/WebServiceParameters.cpp @ 43:9621fd6f17c9
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 09 Nov 2016 17:34:20 +0100 |
parents | dc730d11b101 |
children |
line wrap: on
line diff
--- a/Framework/Orthanc/Core/WebServiceParameters.cpp Wed Nov 09 16:03:52 2016 +0100 +++ b/Framework/Orthanc/Core/WebServiceParameters.cpp Wed Nov 09 17:34:20 2016 +0100 @@ -37,6 +37,10 @@ #include "../Core/Toolbox.h" #include "../Core/OrthancException.h" +#if ORTHANC_SANDBOXED == 0 +# include "../Core/SystemToolbox.h" +#endif + #include <cassert> namespace Orthanc @@ -57,6 +61,7 @@ } +#if ORTHANC_SANDBOXED == 0 void WebServiceParameters::SetClientCertificate(const std::string& certificateFile, const std::string& certificateKeyFile, const std::string& certificateKeyPassword) @@ -66,14 +71,14 @@ throw OrthancException(ErrorCode_ParameterOutOfRange); } - if (!Toolbox::IsRegularFile(certificateFile)) + if (!SystemToolbox::IsRegularFile(certificateFile)) { LOG(ERROR) << "Cannot open certificate file: " << certificateFile; throw OrthancException(ErrorCode_InexistentFile); } if (!certificateKeyFile.empty() && - !Toolbox::IsRegularFile(certificateKeyFile)) + !SystemToolbox::IsRegularFile(certificateKeyFile)) { LOG(ERROR) << "Cannot open key file: " << certificateKeyFile; throw OrthancException(ErrorCode_InexistentFile); @@ -84,6 +89,7 @@ certificateKeyFile_ = certificateKeyFile; certificateKeyPassword_ = certificateKeyPassword; } +#endif static void AddTrailingSlash(std::string& url) @@ -171,12 +177,14 @@ SetUsername(GetStringMember(peer, "Username", "")); SetPassword(GetStringMember(peer, "Password", "")); +#if ORTHANC_SANDBOXED == 0 if (peer.isMember("CertificateFile")) { SetClientCertificate(GetStringMember(peer, "CertificateFile", ""), GetStringMember(peer, "CertificateKeyFile", ""), GetStringMember(peer, "CertificateKeyPassword", "")); } +#endif if (peer.isMember("Pkcs11")) {