Skip to content

Commit 2d5e526

Browse files
committed
fix(Git): Work around a bug with JGit vs MINA
Also see [1] for some more background information about why SSH connections can otherwise block "if there is less entropy available than requested". As a safety measure, this is only done on Linux to not cause any unintended slow-down on Windows, also see [2]. [1]: https://stackoverflow.com/a/59097932/1127485 [2]: https://www.baeldung.com/java-security-egd#testing-the-effect-of-javasecurityegd Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 3112d9d commit 2d5e526

File tree

1 file changed

+5
-0
lines changed
  • plugins/version-control-systems/git/src/main/kotlin

1 file changed

+5
-0
lines changed

plugins/version-control-systems/git/src/main/kotlin/Git.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ class Git(
104104
) : VersionControlSystem() {
105105
companion object {
106106
init {
107+
if (Os.isLinux) {
108+
// Work around a bug in Apache MINA sshd, see https://github.com/eclipse-jgit/jgit/issues/135.
109+
System.setProperty("java.security.egd", "file:/dev/./urandom")
110+
}
111+
107112
// Make sure that JGit uses the exact same authentication information as ORT itself. This addresses
108113
// discrepancies in the way .netrc files are interpreted between JGit's and ORT's implementation.
109114
CredentialsProvider.setDefault(AuthenticatorCredentialsProvider)

0 commit comments

Comments
 (0)