Skip to content

Commit

Permalink
Fixed bug: "Protocol:https: not supported"
Browse files Browse the repository at this point in the history
Fixed issue with web server using an untrusted certificate resulting in an "UNABLE_TO_VERIFY_LEAF_SIGNATURE" error. Untrusted cert will be accepted for now. This feature will be configurable with the next release.
  • Loading branch information
mwittig committed Apr 24, 2015
1 parent 7803b12 commit ada1256
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,8 @@ As part of the device definition you need to provide the `host` and `port`for th
* Added support for automatic HTTP/HTTPS redirection
* Added support for HTTP Basic Auth
* Added support for defining the accepted HTTP Response Status Codes
* Updated README, Added version badge
* Updated README, Added version badge
* 20150424, V0.0.5
* Fixed bug: "Protocol:https: not supported"
* Fixed issue with web server using an untrusted certificate resulting in an "UNABLE_TO_VERIFY_LEAF_SIGNATURE"
error. Untrusted cert will be accepted for now. This feature will be configurable with the next release.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"device-config-schema.coffee",
"LICENSE"
],
"version": "0.0.4",
"version": "0.0.5",
"homepage": "https://github.com/mwittig/pimatic-probe",
"keywords": [
"pimatic",
Expand Down
5 changes: 3 additions & 2 deletions probe.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ module.exports = (env) ->

if config.maxRedirects > 0
@_options.maxRedirects = config.maxRedirects
@_service = if @_options.protocol is 'https' then redirect.https else redirect.http
@_service = if @_options.protocol is 'https:' then redirect.https else redirect.http
else
@_service = if @_options.protocol is 'https' then https else http
@_service = if @_options.protocol is 'https:' then https else http

@_options.rejectUnauthorized = false
@acceptedStatusCodes = if _.isArray(config.acceptedStatusCodes) then config.acceptedStatusCodes else []
if config.username isnt "" and config.password isnt ""
@_options.auth = config.username + ':' + config.password
Expand Down

0 comments on commit ada1256

Please sign in to comment.