Disable https requests to ssh git remotes
My WebStorm project uses an ssh git remote of the form
ssh://myusername@myserver/repos/myproject.git
and this works because I have an entry in my ~/.ssh/config
defining myserver
. (This points to a simple VPS that I own, where I back up my projects.)
The problem is that every time I open my project, WebStorm makes a request to https://myserver:443
, which (for reasons detailed below) results in WebStorm complaining about an untrusted certificate.
I would like to tell WebStorm to stop making this https
request to myserver
.
What's going on
Following https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010617059-Untrusted-Server-Certificate-Warning-Message?page=1#community_comment_360003021440, I added the suggested lines to the debug log settings, and found lines like this:
2023-11-01 11:43:27,664 [93413912] FINE - #c.i.u.p.CommonProxy - CommonProxy.select called for https://myserver:443
in the WebStorm log.
I have used my setup for years with no problem, but I just got a new WiFi router made by Sagemcom, which for some reason resolves requests to https://myserver:443
to point to itself, i.e. to 192.168.1.1
and it serves up its own, self-signed, expired certificate, which makes WebStorm (quite reasonably!) complain about the untrusted cert. If e.g. I use my cell phone's hotspot instead of my new router, the problem goes away. But that's not an acceptable solution.
Unacceptable solutions
This post https://intellij-support.jetbrains.com/hc/en-us/community/posts/4414137297810-Disable-GIT-remote-access- suggests going into Settings > Version Control > Directory Mappings
, and removing the project directory altogether. That's unacceptable, because I want all the other features, like highlighting of modified lines, etc.
Failed solutions
I tried every possible setting on the “Explicitly check for incoming commits on remotes” dropdown, under Settings > Version Control > Git
, but none of these solved the problem.
Workaround
My current workaround is to add an entry in my /etc/hosts
making myserver
resolve to the 127.0.0.1
loopback. This works, as long as I'm not serving anything on 443 on my machine. WebStorm is unable to connect when it requests https://myserver:443
, and evidently it's happy enough to just fail silently. Fine. But if I'm testing a server on port 443 on my machine, this workaround will fail.
Desired solution
If there's an existing, simple solution to this problem, please let me know! Otherwise, I think it would be reasonable to have a way to tell WebStorm that a given ssh remote is simply not going to respond to the https request it wants to make (whatever that request is for).
Please sign in to leave a comment.
Hi,
Can you try disabling Github, Gitlab + Space plugin?
Let us know if this worked.
Hi, and thanks for your response! Among GitHub, GitLab, and Space, I only have GitHub and Space.
Disabling Space alone seems to solve the problem! I guess as long as I don't want to use the Space plugin, this is a good solution. Thanks!
I do still think it might make sense to have a section in the config panel for each of these plugins, where you can tell them to ignore certain remotes. Maybe just a listing of remotes, with checkboxes beside them?
Hi,
Can you please open this as a feature request on: https://youtrack.jetbrains.com/
Opened in https://youtrack.jetbrains.com/issue/WEB-63821/Configure-Space-plugin-to-ignore-certain-git-remotes
Thank you very much.