Currently, I am in the process of migrating the TeamCity Agent from AWS Linux2 to AWS Linux2023. I have a problem with the git-version application. I'm receiving an error:
LibGit2Sharp.LibGit2SharpException: could not load ssl libraries
Analysing the source code, I found that this is caused by the 'normalization' step that is executed in case a build agent is detected (which is also described in the documentation).
Disabling this option using the /nonormalize flag prevents the error from occurring.
However, I would like to figure out what is causing the problem and fix it if possible. The only difference I noticed between the 2 systems is that on AWS Linux 2 there's OpenSSL 1 and on the AL2023 there's OpenSSL3 installed. But (at least in theory) LibGit2Sharp supports OpenSSL3.
I had similar issue. For me the solution was to use Pre-release 6.0.0-beta.5 version of Gitversion. LibGit2Sharp was bumped two times between version 5.12.0 (latest release as of now) to 6.0.0-beta.5.