52 lines
1.7 KiB
Java
52 lines
1.7 KiB
Java
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.scheduling.annotation.EnableScheduling;
|
|
|
|
/**
|
|
* 启动程序
|
|
*
|
|
* @author ruoyi
|
|
*/
|
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
|
@EnableScheduling
|
|
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("""
|
|
Hello, 世界! 🌍
|
|
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);
|
|
}
|
|
}
|