[VSCode + LS] Improve logging for network settings and status
Problem to solve
We commonly have customers enable the ignoreCertificateErrors setting in the GitLab Workflow extension, to bypass issues caused by various enterprise network configurations (e.g. custom certificates, or a deep packet inspection firewall).
Customers setting up the extension for the first time may find that it takes several cycles with GitLab Support to debug the root cause of the certificate error.
This issue proposes improving the logging around our network stack to enable customers to self-troubleshoot more easily and set up the extension/instance with fewer round trips with GitLab Support / Engineering.
Proposal
(From a slack discussion with @erran - thanks!)
We can add more clear logging from GitLab Workflow that:
- DEBUG Prints the detected certificate fingerprint (SHA256 and/or MD5) upon failure and logs the connection error including domain and fingerprint.
- DEBUG Print the CA certificate SHA256 and/or MD5 checksum when it was configured for requests.
- INFO Print they key/value pairs for all VS Code network configuration values detected (omit the password if present in the proxy URL).
The above log details can also be implemented in GitLab language server where appropriate which could would ensure we have some minimal information for all extensions.
Setting the ignoreCertificateErrors flag applies for all requests, which would swallow the connection error, so perhaps if we detect that flag we could do a 'test' connection on startup without the flag and catch + log the error that way.
This could have other benefits - e.g. if no connection error is detected we could suggest that it's safe to disable the ignore certificate errors setting (would need to test all endpoints in this case).