更新时间:2022-06-10 22:15:47
try {
SSLContext ctx = SSLContext.getInstance("TLSv1.2");
ctx.init(null, null, null);
SSLContext.setDefault(ctx);
} catch (Exception e) {
System.out.println(e.getMessage());
}
您可以使用此代码将SSL的默认协议设置为TLS 1.2和然后写下你的其他陈述。
You can use this code the set the default protocol for SSL to TLS 1.2 and then write your other statements.