# HG changeset patch # User Alain Mazy # Date 1715102452 -7200 # Node ID 3487684fd3312cde88f764341ba3e69a4fb1b067 # Parent 317850cd46bc018bbb929dd631dd0cd9bd3646b7# Parent f84301e077cfb15c28cdf5f955ad2f8e2fe421f7 merge diff -r f84301e077cf -r 3487684fd331 NEWS --- a/NEWS Tue May 07 13:59:14 2024 +0200 +++ b/NEWS Tue May 07 19:20:52 2024 +0200 @@ -16,6 +16,12 @@ * Removed potential PHI from the logs when Orthanc encounters an error while creating a zip file. +Bug Fixes +--------- + +* When working with "DicomTlsEnabled": true and "DicomTlsRemoteCertificateRequired": false, + Orthanc was refusing to start if no "DicomTlsTrustedCertificates" was provided. + REST API -------- diff -r f84301e077cf -r 3487684fd331 OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp --- a/OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp Tue May 07 13:59:14 2024 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp Tue May 07 19:20:52 2024 +0200 @@ -76,7 +76,7 @@ throw OrthancException(ErrorCode_ParameterOutOfRange, "Unknown role"); } - if (!SystemToolbox::IsRegularFile(trustedCertificatesPath)) + if (requireRemoteCertificate && !SystemToolbox::IsRegularFile(trustedCertificatesPath)) { throw OrthancException(ErrorCode_InexistentFile, "Cannot read file with trusted certificates for DICOM TLS: " + trustedCertificatesPath); @@ -120,7 +120,7 @@ new DcmTLSTransportLayer(tmpRole /*opt_networkRole*/, NULL /*opt_readSeedFile*/, OFFalse /*initializeOpenSSL, done by Orthanc::Toolbox::InitializeOpenSsl()*/)); - if (IsFailure(tls->addTrustedCertificateFile(trustedCertificatesPath.c_str(), DCF_Filetype_PEM /*opt_keyFileFormat*/))) + if (requireRemoteCertificate && IsFailure(tls->addTrustedCertificateFile(trustedCertificatesPath.c_str(), DCF_Filetype_PEM /*opt_keyFileFormat*/))) { throw OrthancException(ErrorCode_BadFileFormat, "Cannot parse PEM file with trusted certificates for DICOM TLS: " + trustedCertificatesPath); diff -r f84301e077cf -r 3487684fd331 OrthancFramework/Sources/HttpServer/HttpOutput.cpp --- a/OrthancFramework/Sources/HttpServer/HttpOutput.cpp Tue May 07 13:59:14 2024 +0200 +++ b/OrthancFramework/Sources/HttpServer/HttpOutput.cpp Tue May 07 19:20:52 2024 +0200 @@ -428,8 +428,13 @@ void HttpOutput::Redirect(const std::string& path) { + /** + * "HttpStatus_301_MovedPermanently" was used in Orthanc <= + * 1.12.3. This caused issues on changes in the configuration of + * Orthanc. + **/ stateMachine_.ClearHeaders(); - stateMachine_.SetHttpStatus(HttpStatus_301_MovedPermanently); + stateMachine_.SetHttpStatus(HttpStatus_307_TemporaryRedirect); stateMachine_.AddHeader("Location", path); stateMachine_.SendBody(NULL, 0); } diff -r f84301e077cf -r 3487684fd331 OrthancFramework/Sources/Logging.h --- a/OrthancFramework/Sources/Logging.h Tue May 07 13:59:14 2024 +0200 +++ b/OrthancFramework/Sources/Logging.h Tue May 07 19:20:52 2024 +0200 @@ -224,6 +224,7 @@ public: InternalLogger(LogLevel level, LogCategory category, + const char* pluginName /* ignored */, const char* file /* ignored */, int line /* ignored */) : level_(level), @@ -231,15 +232,6 @@ { } - // For backward binary compatibility with Orthanc Framework <= 1.8.0 - InternalLogger(LogLevel level, - const char* file /* ignored */, - int line /* ignored */) : - level_(level), - category_(LogCategory_GENERIC) - { - } - ~InternalLogger(); template