diff --git a/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp b/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp index cda011cdd918a1810ba21a6c2f56390600781bb4..79bbff32032fd42f932dc3cbf4700b9012c93d00 100644 --- a/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp +++ b/Privacy/privacy/src/main/ets/pages/Cybersecurity.cpp @@ -32,7 +32,7 @@ curl_easy_setopt( curl, CURLOPT_CATH, "/etc/security/certificates"); "base-config": { "trust-anchors": [ { - "certificates": "/res/appCaCert" + "certificates": "/data/storage/el1/bundle/entry/resources/resfile/appCaCert" } ] }, @@ -46,7 +46,7 @@ curl_easy_setopt( curl, CURLOPT_CATH, "/etc/security/certificates"); ], "trust-anchors": [ { - "certificates": "/res/domainCaCert" + "certificates": "/data/storage/el1/bundle/entry/resources/resfile/domainCaCert" } ] } @@ -60,7 +60,7 @@ curl_easy_setopt( curl, CURLOPT_CATH, "/etc/security/certificates"); * 场景六:配置信任应用管理的CA证书-应用使用三方库进行网络连接 */ // [Start cybersecurity_trusting_ca_others] -curl_easy_setopt( curl, CURLOPT_CATH, "/res/domainCaCert"); +curl_easy_setopt( curl, CURLOPT_CATH, "/data/storage/el1/bundle/entry/resources/resfile/domainCaCert"); // [End cybersecurity_trusting_ca_others] /** diff --git a/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets b/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets index 8ed8fdfee6fee4af759d29c6453585a2fdb81a5c..4cbd405fa04dea5383391e398d080cde3e966c22 100644 --- a/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets +++ b/Privacy/privacy/src/main/ets/pages/NetworkTrust.ets @@ -16,7 +16,7 @@ httpRequest.request( 'EXAMPLE_URL', { extraData: 'data to send', expectDataType: http.HttpDataType.STRING, connectTimeout: 60000, - caPath:'/res/domainCaCert', // Specifies the trusted CA certificate path + caPath:'/data/storage/el1/bundle/entry/resources/resfile/domainCaCert', // Specifies the trusted CA certificate path }, (err: BusinessError, data: http.HttpResponse) => { // ... }) @@ -29,7 +29,7 @@ httpRequest.request( 'EXAMPLE_URL', { // [Start cybersecurity_rcp_trusting_ca] const caPath: rcp.CertificateAuthority = { - folderPath: '/res/appCaCert', // 指定信任的CA证书路径 + folderPath: '/data/storage/el1/bundle/entry/resources/resfile/appCaCert', // 指定信任的CA证书路径 } const securityConfig: rcp.SecurityConfiguration = { remoteValidation: caPath diff --git a/Privacy/privacy/src/main/resources/rawfile/resfile/appCaCert/server.crt b/Privacy/privacy/src/main/resources/rawfile/resfile/appCaCert/server.crt new file mode 100644 index 0000000000000000000000000000000000000000..33a3a7854e9c549e476d5e9374171e1d594c67df --- /dev/null +++ b/Privacy/privacy/src/main/resources/rawfile/resfile/appCaCert/server.crt @@ -0,0 +1 @@ +// This file is provided solely as a sample, and developers are required to replace it. \ No newline at end of file diff --git a/Privacy/privacy/src/main/resources/rawfile/resfile/domainCaCert/server.crt b/Privacy/privacy/src/main/resources/rawfile/resfile/domainCaCert/server.crt new file mode 100644 index 0000000000000000000000000000000000000000..33a3a7854e9c549e476d5e9374171e1d594c67df --- /dev/null +++ b/Privacy/privacy/src/main/resources/rawfile/resfile/domainCaCert/server.crt @@ -0,0 +1 @@ +// This file is provided solely as a sample, and developers are required to replace it. \ No newline at end of file