Skip to content

Commit 0df044a

Browse files
authored
Merge pull request #571 from dynamsoft-docs/preview
Preview
2 parents f82ac19 + 166147b commit 0df044a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

faq/failed-to-load-resource.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ In this case, if you are trying to access an application that integrates a versi
3333
Note: the new certificate from Dynamsoft will expire on December 8th, 2023. This means you will need to update the certificate again after this certificate expires.
3434
- Method 3. <a href="{{site.about}}getsupport.html" target="_blank">Contact Dynamsoft</a> for a new MSI for client-side.
3535

36-
- For v17.2 or higher versions, use the new API <a href="{{site.info}}api/Dynamsoft_WebTwainEnv.html#updatecert" target="_blank">UpdateCert</a> to automatically update the client side certificate before it expires. The following is an sample code:
36+
- For v17.2 or higher versions, use the new API <a href="{{site.info}}api/Dynamsoft_WebTwainEnv.html#updatecert" target="_blank">UpdateCert</a> to automatically update the client side certificate before it expires. **Please go to dynamsoft.webtwain.install.js file in the Resource Folder and search the keyword "OnSSLCertInfo"**, add the following lines of code:
3737
```javascript
38-
// Add the code in dynamsoft.webtwain.config.js file
39-
Dynamsoft.DWT.ServiceCertUpdateURL= "https://demo.dynamsoft.com/DWT/Resources/dist/cert.zip";
40-
```
41-
```javascript
42-
// Add the code in dynamsoft.webtwain.install.js file
43-
Dynamsoft.DWT.UpdateCert(
44-
Dynamsoft.DWT.ServiceCertUpdateURL,
45-
function () {
46-
},
47-
function (errorCode, errorString) {
48-
console.log(errorString);
38+
Dynamsoft.OnSSLCertInfo = function (sslExpiredDate) {
39+
if ((sslExpiredDate - new Date()) / 86400000 < 15) { // Automatically updates 15 days before expiration
40+
Dynamsoft.DWT.UpdateCert(
41+
"https://demo.dynamsoft.com/DWT/Resources/dist/cert.zip",
42+
function () {
43+
//Success callback
44+
},
45+
function (errorCode, errorString) {
46+
console.log(errorString);
47+
}
48+
);
4949
}
50-
);
50+
};
5151
```
5252

5353
<!--

0 commit comments

Comments
 (0)