This commit is contained in:
1009473166@qq.com
2026-07-31 10:16:48 +08:00
parent 2b86d14f56
commit 0a021caba6
187 changed files with 8938 additions and 2072 deletions

View File

@@ -1,9 +1,11 @@
package com.ruoyi;
import java.security.Security;
import java.util.Arrays;
import java.util.stream.Collectors;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
@@ -17,6 +19,7 @@ public class RuoYiApplication
{
public static void main(String[] args)
{
enableSqlServerLegacyTls();
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args);
System.out.println("""
@@ -24,4 +27,25 @@ public class RuoYiApplication
This is a text block with Unicode characters.
""");
}
private static void enableSqlServerLegacyTls()
{
if (!Boolean.parseBoolean(System.getProperty("ruoyi.sqlserver.legacyTls.enabled", "true")))
{
return;
}
String propertyName = "jdk.tls.disabledAlgorithms";
String disabledAlgorithms = Security.getProperty(propertyName);
if (disabledAlgorithms == null || disabledAlgorithms.isBlank())
{
return;
}
String compatibleAlgorithms = Arrays.stream(disabledAlgorithms.split(","))
.map(String::trim)
.filter(algorithm -> !"TLSv1".equalsIgnoreCase(algorithm))
.collect(Collectors.joining(", "));
Security.setProperty(propertyName, compatibleAlgorithms);
}
}