Skip to content

Protocol not supported error on plugin redirecting to HTTPS target #81

@victoranaylton

Description

@victoranaylton

Hello All,

I have a plugin that overrides the target URL for one set in the plugin configuration.

On this plugin, i'm changing the req.targetHostname and req.targetPath and, if the target protocol is https, i'm also changing the req.targetSecure to true and the req.targetPort to 443

req.targetHostname = targetPathHostname // new target hostname req.targetPath = targetPath // new target path if (targetPathProtocol === 'https') { req.targetSecure = true req.targetPort = 443 } 

With this, when the request is executed, i'm getting the following error:

curl -i http://localhost:8000/health HTTP/1.1 500 Internal Server Error Date: Wed, 24 May 2017 12:57:14 GMT Connection: keep-alive Content-Length: 67 {"message":"Protocol \"https:\" not supported. Expected \"http:\""}

Just to be sure, i've configured my edgemicro instance to work with ssl but the error was the same:

curl -i https://localhost:8000/health HTTP/1.1 500 Internal Server Error Date: Wed, 24 May 2017 12:57:14 GMT Connection: keep-alive Content-Length: 67 {"message":"Protocol \"https:\" not supported. Expected \"http:\""}

Is it possible to do this? Change the target URL and also change from HTTP to HTTPS?

I'm using the following versions:

current nodejs version is v6.10.0 current edgemicro version is 2.4.5-beta 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions