diff --git a/gradle/changelog/random.yaml b/gradle/changelog/random.yaml new file mode 100644 index 0000000000..d4be22f7dc --- /dev/null +++ b/gradle/changelog/random.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Server freeze during random token generation on startup diff --git a/scm-webapp/src/main/java/sonia/scm/lifecycle/RandomPasswordGenerator.java b/scm-webapp/src/main/java/sonia/scm/lifecycle/RandomPasswordGenerator.java index b28f82628c..285c6c08f4 100644 --- a/scm-webapp/src/main/java/sonia/scm/lifecycle/RandomPasswordGenerator.java +++ b/scm-webapp/src/main/java/sonia/scm/lifecycle/RandomPasswordGenerator.java @@ -18,17 +18,12 @@ package sonia.scm.lifecycle; import org.apache.commons.lang.RandomStringUtils; -import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; final class RandomPasswordGenerator { String createRandomPassword() { - try { - SecureRandom random = SecureRandom.getInstanceStrong(); - return RandomStringUtils.random(20, 0, 0, true, true, null, random); - } catch (NoSuchAlgorithmException e) { - throw new IllegalStateException("Every Java distribution is required to support a strong secure random generator; this should not have happened", e); - } + SecureRandom random = new SecureRandom(); + return RandomStringUtils.random(20, 0, 0, true, true, null, random); } }