优化华为短信代码

This commit is contained in:
阿沐 2022-09-29 23:08:58 +08:00
parent f0e8642dec
commit e34df5aaaa

View File

@ -60,7 +60,9 @@ public class HuaweiSmsStrategy implements SmsStrategy {
// 使用 https // 使用 https
trustAllHttpsCertificates(); trustAllHttpsCertificates();
URL realUrl = new URL(smsConfig.getUrl()); // 接入地址
String url = smsConfig.getUrl() + "/sms/batchSendSms/v1";
URL realUrl = new URL(url);
HttpsURLConnection connection = (HttpsURLConnection) realUrl.openConnection(); HttpsURLConnection connection = (HttpsURLConnection) realUrl.openConnection();
HostnameVerifier hv = (hostname, session) -> true; HostnameVerifier hv = (hostname, session) -> true;
connection.setHostnameVerifier(hv); connection.setHostnameVerifier(hv);