I am using Matlab Compiler SDK to compile some Matlab code to .net DLL that I use as a dependency in a dotnet code 5 project. In general everything works and as you can see the documentation points out that setting the env var LD_LIBRARY_PATH is key for this functionality.
What breaks is that I can't anymore make request to https end points with self signed certificates (all AWS services DynamoDB, S3, etc...). The problem disappears as I take out the LD_LIBRARY_PATH with Matlab libraries, but of course when I do that Matlab binaries don't work anymore.
I have been reading articles like this one, yet I didn't manage to fix this SSL issue, that of course I can bypass but I don't intend to. .net exception
The SSL connection could not be established, see inner exception. The remote certificate is invalid according to the validation procedure.
INNER EXCEPTION: The remote certificate is invalid because of errors in > the certificate chain: PartialChain
I found out that the specific libraries that is causing this exception are:
- /opt/mcr/v99/bin/glnxa64/libssl.so.1.1
- /opt/mcr/v99/bin/glnxa64/libssl.so.1
- /opt/mcr/v99/bin/glnxa64/libcrypto.so.1.1
- /opt/mcr/v99/bin/glnxa64/libcrypto.so.1
They are provided by Matlab and added to LD_LIBRARY_PATH.
I have tried to remove those and link the system one and in this way I fix the SSL issue, but I break Matlab execution.
Useful articles