Skip to content

Need to support SNI #14

Description

@xiaoshimimi

While I'm using https-proxy-agent to send request, if the request option set servername (which might not the same as host) https-proxy-agent will ignore my servername, this will cause the certificate error.

      if (opts.secureEndpoint) {
        // since the proxy is connecting to an SSL server, we have
        // to upgrade this socket connection to an SSL connection
        debug('upgrading proxy-connected socket to TLS connection: %o', opts.host);
        opts.socket = socket;
        **opts.servername = opts.host;**
        opts.host = null;
        opts.hostname = null;
        opts.port = null;
        sock = tls.connect(opts);
      }

Could you please change this part to:
opts.servername = opts.servername?opts.servername:opts.host;
so that it can support SNI?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions