support https ca certify

Signed-off-by: lushi <lushi@huawei.com>
Change-Id: I6bc29eb5edacd62fce8ce62063ac1a115b93d448
This commit is contained in:
lushi 2022-02-19 17:13:35 +08:00
parent 7c75cd65d3
commit 677f565c71
5 changed files with 3341 additions and 4 deletions

View File

@ -63,6 +63,7 @@ Note:If the text contains special characters, please escape them according to th
<filefilter name="binaryFileTypePolicyFilter" desc="二进制文件校验策略的过滤条件" >
<filteritem type="filepath" name="frameworks/base/resource/binary/mac/.*.o" desc="来源于代码仓foundation/ace/ace_engine/frameworks/base/resource/binary下的svg编译而来。现有的objcopy工具链在mac上不能用使用开源工具转换成.o。"/>
<filteritem type="filepath" name="adapter/preview/sdk/cacert.pem" desc="三方库libcurl在windows环境下使用的公钥证书文件由Mozilla的根证书文件解压得到。"/>
<filteritem type="filepath" name="frameworks/base/network/cacert.pem" desc="三方库libcur使用的公钥证书文件curl官网下载得到。"/>
</filefilter>
<filefilter name="binaryFileTypePolicyFilter" desc="二进制文件校验策略的过滤条件" >
<filteritem type="filepath" name="test/resource/graphicalbasicability/imageprovider/images/broken.bmp" desc="自造的二进制图片"/>

View File

@ -1,4 +1,4 @@
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@ -73,7 +73,10 @@ template("ace_base_source_set") {
if (defined(config.use_curl_download) && config.use_curl_download) {
configs += [ "//third_party/curl:curl_config" ]
sources += [ "$ace_root/frameworks/base/network/download_manager.cpp" ]
deps += [ "//third_party/curl:curl" ]
deps += [
"$ace_root/frameworks/base/network:cacert.pem",
"//third_party/curl:curl",
]
}
cflags_cc = []

View File

@ -0,0 +1,22 @@
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
import("//foundation/ace/ace_engine/ace_config.gni")
ohos_prebuilt_etc("cacert.pem") {
relative_install_dir = "ssl/certs"
source = "cacert.pem"
part_name = ace_engine_part
subsystem_name = "ace"
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -63,7 +63,7 @@ public:
// Some servers don't like requests that are made without a user-agent field, so we provide one
ACE_CURL_EASY_SET_OPTION(handle.get(), CURLOPT_USERAGENT, "libcurl-agent/1.0");
ACE_CURL_EASY_SET_OPTION(handle.get(), CURLOPT_URL, url.c_str());
ACE_CURL_EASY_SET_OPTION(handle.get(), CURLOPT_CAINFO, "/etc/ssl/certs/cacert.pem");
ACE_CURL_EASY_SET_OPTION(handle.get(), CURLOPT_VERBOSE, 1L);
ACE_CURL_EASY_SET_OPTION(handle.get(), CURLOPT_ERRORBUFFER, errorStr_.data());