SUPER simple bugfix ... could you please commit a fix?

We have

"DicomTlsEnabled" : false,
"DicomTlsCertificate" : "/root/keys/key.pub",
"DicomTlsPrivateKey" : "/root/keys/key",

and the two files are inexistent of course because we set "DicomTlsEnabled" : false,. Nevertheless, despite this, if both DicomTlsCertificate and DicomTlsPrivateKey are present, orthanc fails to start.

Take this permalink for example for correct line numbers: https://github.com/jodogne/OrthancMirror/blob/branches/Orthanc-1.10.1/OrthancServer/Sources/main.cpp

The culprit is here: github com/jodogne/OrthancMirror/blob/branches/Orthanc-1.10.1/OrthancServer/Sources/main.cpp#L1521-L1525

These two statements need to be wrapper in if (lock.GetConfiguration().GetBooleanParameter(KEY_DICOM_TLS_ENABLED, false)) just like it is in github com/jodogne/OrthancMirror/blob/branches/Orthanc-1.10.1/OrthancServer/Sources/main.cpp#L1256-L1263

Thanks

Hello,

Thanks for your suggestion. However, the DicomTlsEnabled option asks Orthanc to start its DICOM SCP (server) using DICOM TLS. On the other hand, the options DicomTlsCertificate and DicomTlsPrivateKey apply to both DICOM SCP (server) and DICOM SCU (client).

But, the lines you spotted are related to DICOM SCU, so wrapping them with a test on DicomTlsEnabled would be incorrect (as the latter option applies to DICOM SCP).

From my perspective, it is totally logical that Orthanc refuses to start if its configuration file references a nonexistent file that could be used at any time in the future (i.e., if Orthanc is asked to initiate a DICOM SCU connexion with TLS), especially given that in the current situation, the logs are perfectly clear about the source of the error:

$ ./Orthanc configuration.json 
W0903 09:48:38.927270 main.cpp:2034] Orthanc version: mainline (20230903T073350)
[...]
E0903 09:48:38.953621 OrthancException.cpp:61] Inexistent file: Inexistent file: /root/keys/key
E0903 09:48:38.953704 main.cpp:2091] Uncaught exception, stopping now: [Inexistent file] (code 13)
W0903 09:48:38.953710 main.cpp:2122] Orthanc has stopped

The solution is simply to comment out the culprit options in your configuration file.

Kind Regards,
Sébastien-

1 Like

Hi and thank you @jodogne, that makes sense and many thanks for your work on this project!

1 Like