add sys props

This commit is contained in:
Looly
2022-03-22 10:16:06 +08:00
parent 37faf6d27b
commit 2ac275dd8f
4 changed files with 12 additions and 6 deletions

View File

@@ -23,7 +23,7 @@ public enum GlobalHeaders {
/**
* 存储头信息
*/
Map<String, List<String>> headers = new HashMap<>();
final Map<String, List<String>> headers = new HashMap<>();
/**
* 构造
@@ -43,6 +43,10 @@ public enum GlobalHeaders {
// https://stackoverflow.com/questions/9096987/how-to-overwrite-http-header-host-in-a-httpurlconnection/9098440
System.setProperty("sun.net.http.allowRestrictedHeaders", "true");
//解决server certificate change is restricted during renegotiation问题
System.setProperty("jdk.tls.allowUnsafeServerCertChange", "true");
System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");
if (isReset) {
this.headers.clear();
}