question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a setting to allow the language server to be downloaded via HTTP to avoid MitM firewalls

See original GitHub issue

Environment data

  • VS Code version: 1.28.0
  • Extension version (available under the Extensions sidebar): 2018.9.0
  • OS and version: Xubuntu 16.04
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7.12
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

When trying to select my Python linter, I get a “command ‘python.setLinter’ not found” error. After checking the developer tools console, it looks like the Python extension is unable to activate due to a self signed certificate in the certificate chain because I’m on a corporate network. It looks like it’s specifically failing to update from the language server. See logs below. I have disabled “proxy strict SSL” in my user settings but this doesn’t seem to have an effect on extensions.

Expected behavior

I should be able to ignore this SSL error so that I can use the Python extension.

Steps to reproduce:

  1. Install Python VS Code extension
  2. Try to “Select Linter”

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Microsoft Python language server.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

console.ts:136 [Extension Host] Python Extension: Listing Nuget Packages, Arg 1: "https://pvsc.blob.core.windows.net", Arg 2: "python-language-server-stable", Arg 3: "Python-Language-Server-linux-x64" Error: self signed certificate in certificate chain
	at TLSSocket.<anonymous> (_tls_wrap.js:1103:38)
	at emitNone (events.js:106:13)
	at TLSSocket.emit (events.js:208:7)
	at TLSSocket._finishInit (_tls_wrap.js:637:8)
	at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:467:38)

console.ts:136 [Extension Host] Python Extension: Get latest language server nuget package version, , Return Value:  Error: self signed certificate in certificate chain
	at TLSSocket.<anonymous> (_tls_wrap.js:1103:38)
	at emitNone (events.js:106:13)
	at TLSSocket.emit (events.js:208:7)
	at TLSSocket._finishInit (_tls_wrap.js:637:8)
	at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:467:38)

console.ts:136 [Extension Host] Python Extension: Get latest version of Language Server, , Return Value:  Error: self signed certificate in certificate chain
	at TLSSocket.<anonymous> (_tls_wrap.js:1103:38)
	at emitNone (events.js:106:13)
	at TLSSocket.emit (events.js:208:7)
	at TLSSocket._finishInit (_tls_wrap.js:637:8)
	at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:467:38)

console.ts:136 [Extension Host] Python Extension: Get language server folder name, , Return Value:  TypeError: Cannot read property 'version' of undefined
	at LanguageServerFolderService.<anonymous> (/home/kjacoby/.vscode/extensions/ms-python.python-2018.9.0/out/client/activation/languageServerFolderService.js:49:61)
	at Generator.next (<anonymous>)
	at fulfilled (/home/kjacoby/.vscode/extensions/ms-python.python-2018.9.0/out/client/activation/languageServerFolderService.js:15:58)
	at <anonymous>
	at process._tickCallback (internal/process/next_tick.js:188:7)

console.ts:136 [Extension Host] Activating extension 'ms-python.python' failed: Cannot read property 'version' of undefined.

console.ts:136 [Extension Host] Activating extension `ms-python.python` failed:  Cannot read property 'version' of undefined

console.ts:136 [Extension Host] Here is the error stack:  TypeError: Cannot read property 'version' of undefined
	at LanguageServerFolderService.<anonymous> (/home/kjacoby/.vscode/extensions/ms-python.python-2018.9.0/out/client/activation/languageServerFolderService.js:49:61)
	at Generator.next (<anonymous>)
	at fulfilled (/home/kjacoby/.vscode/extensions/ms-python.python-2018.9.0/out/client/activation/languageServerFolderService.js:15:58)
	at <anonymous>
	at process._tickCallback (internal/process/next_tick.js:188:7)

extensionService.ts:1006 Activating extension 'ms-python.python' failed: Cannot read property 'version' of undefined.

notificationsAlerts.ts:40 Error: command 'python.setLinter' not found

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
brettcannoncommented, Oct 17, 2018

Based on this message from vscode we could try and support "http.proxyStrictSSL": false and use HTTP in those instances (or figure out how to make the request over HTTPS w/o validating certs).

2reactions
aloysbailletcommented, Oct 17, 2018

Ideally if the extension could check for the main strictSSL settings and disable certificate checks that would be ideal! I managed to manually download the language server file by installing the extension at home and sending the exact url to my work email address as the url cannot be easily guessed, so all good now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Man in the Middle (MITM) Attacks - Rapid7
Man-in-the-middle attacks (MITM) are a common type of cybersecurity attack that allows attackers to eavesdrop on the communication between two targets.
Read more >
BetterCAP stable documentation
BetterCAP is a powerful, flexible and portable tool created to perform various types of MITM attacks against a network, manipulate HTTP, HTTPS and...
Read more >
What is MITM (Man in the Middle) Attack | Imperva
In a Man In the Middle (MITM) attack a perpetrator gets in the middle of communication to eavesdrop or impersonate. Find out how...
Read more >
Tweak Settings - cPanel & WHM Documentation
This setting allows resellers to create accounts with subdomains on your server's main domain. For example, if your hostname is server.example.
Read more >
What is a Man in the Middle Attack? Types, Prevention ...
Prevent different types of attacks, with real life examples. ... Attackers have many different reasons and methods for using a MITM attack.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found