代码如下:
let file = `${downloadDir}/${downloadFileName}`
LOGD(TAG, `executeJSFunc AppDownloader start download: ${file}`);
request.downloadFile(context, {
url: url,
filePath: file
}).then((downloadTask: request.DownloadTask) => {
downloadTask.on('complete', () => {
LOGD(TAG, 'executeJSFunc AppDownloader download complete');
resolve(0)
})
downloadTask.on('fail', (err) => {
LOGD(TAG, 'executeJSFunc AppDownloaderDownload task failed. Cause:' + err);
resolve(err == 0 ? -1 : err)
})
}).catch((err: BusinessError) => {
LOGD(TAG, `executeJSFunc AppDownloader Invoke downloadTask failed, code is ${err.code}, message is ${err.message}`);
resolve(err.code == 0 ? -1 : err.code)
});
Beta2排除了不安全的算法套,测试环境的服务器证书采用CBC分组模式(安全强度弱,Beta2不支持CBC),导致密码套协商不成功openssl握手失败。
规避方案:测试服务器调整一下接受的加解密算法即可,分组算法上增加GCM。