vscode: Unable switch to HTTPS for Local Port Forwarding

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.85.1
  • OS Version: Windows_NT x64 10.0.19045
Version: 1.85.1 (user setup)
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:49:37.021Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

Steps to Reproduce:

  1. Create a sample Angular project (for testing tls connection)

    npm i -g @angular/cli
    
    ng new demo1 --ssr=false --style=css
    cd demo1
    ng serve --ssl
    

    At this moment, it will listen https://localhost:4200/

    image

  2. Open with VSCode and create a new Local Port Forwarding

    code .
    

    I tried to switch to HTTPS.

    image

    It never switch to HTTPS.

    image

    Preview in Editor

    image

    It never response.

    image

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Reactions: 7
  • Comments: 18 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Glad to see it’s not just me struggling with this issue!

https://github.com/microsoft/vscode/issues/201371

For anyone wanting to get this working while they fix the issue, you can download the devtunnel cli and follow the guide here.

For linux machines:

  • Download devtunnel using:
curl -sL https://aka.ms/DevTunnelCliInstall | bash
  • Then login and register with your microsoft account:
devtunnel user login
  • Finally run the command mentioned by @doggy8088 above with your desired port:
devtunnel host -p 8080 --protocol https

Solved all my problems… In the meanwhile thanks for your great work on vscode @connor4312. I hope it’ll be fixed soon! 😃

@alexr00 I think dev tunnel do support HTTP to the backend. Do we saying the same product?

Check here: https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/cli-commands

Example:

devtunnel host -p 4200 --protocol http

See also:

devtunnel host --help

@connor4312 ok, so is the plan now to keep the protocol switching menu (not bother with adding auto due to it’s seeming uselessness) and when a user switches protocol, instead of updating the existing dev tunnel, it will be closed/reopened instead using the new protocol?

@alexr00 Please tell me I’ve misunderstood things again, because dev tunnels in vs code works just fine with http protocol as I mentioned in my original issue.

Per @connor4312 in https://github.com/microsoft/vscode/issues/201465#issuecomment-1881501118, switching the protocol is not supported in Dev Tunnels. I’ve added a way for the Dev Tunnels extension to simply remove this functionality for ports forwarded by Dev Tunnels. Once @connor4312 adopts this in the Dev Tunnels extension you should be all set with https as the default, as I assume, Dev Tunnels will also just use https as the default.

I have no need to switch dev tunnels between HTTP and HTTPS. How can I add a port with HTTPS at the beginning for this new change?