Skip to content

Commit

Permalink
Allow self-signed certificates - fixes #140
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed May 30, 2023
1 parent ace4fbb commit 03efd3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ iobroker add octoprint
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**

* (klein0r) Allow self-signed certificates

### 5.0.0 (2023-05-24)

Tested with OctoPrint 1.9.0
Expand Down
4 changes: 4 additions & 0 deletions lib/plugins/slicerthumbnails.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

const https = require('node:https');
const axios = require('axios').default;

async function downloadThumbnailsToFiles(adapter) {
Expand Down Expand Up @@ -33,6 +34,9 @@ async function downloadThumbnailFor(adapter, filePath, thumbnailUrl) {
validateStatus: (status) => {
return [200].indexOf(status) > -1;
},
httpsAgent: new https.Agent({
rejectUnauthorized: !adapter.config.allowSelfSignedCertificates,
}),
});

if (response.data) {
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const utils = require('@iobroker/adapter-core');
const https = require('https');
const https = require('node:https');
const axios = require('axios').default;
const adapterName = require('./package.json').name.split('.').pop();

Expand Down

0 comments on commit 03efd3b

Please sign in to comment.