gioboa / jira-plugin

Jira plugin for VsCode
https://marketplace.visualstudio.com/items?itemName=gioboa.jira-plugin
MIT License
266 stars 41 forks source link

Plugin doesn't handle SSL-errors/untrusted CA/self-signed JIRA certs gracefully #1

Closed deftdawg closed 6 years ago

deftdawg commented 6 years ago

Hi, thanks for your work on this plugin.

I work in a corporate environment where our JIRA instance runs a SSL certificate issued by our corporate CA, the CA is in the Desktop's CA certificate store, however it is not in the VS Code bundled CA certificate store. When I first tried your plugin I got "Failed to connect", upon opening the Developer Tools Console I got the message at the bottom.

This type of error might also occur if someone setup up JIRA with a self-signed certificate.

If the user is on a managed Windows desktop in a corporate environment, you may suggest they install the win-ca vscode plugin which will import the desktop's trusted CAs into VSCode. Or otherwise look into importing their JIRA cert into the VS Code certificate store.

Once I installed win-ca, I was able to use your plugin.

log.ts:171
 ERR Cannot read property 'split' of undefined: TypeError: Cannot read property 'split' of undefined
    at IssueLinkProvider.get projectNames [as projectNames] (C:\Users\useraccount\.vscode\extensions\gioboa.jira-plugin-0.2.0\out\src\shared\document-link-provider.js:10:63)
    at document.getText.split.reduce (C:\Users\useraccount\.vscode\extensions\gioboa.jira-plugin-0.2.0\out\src\shared\document-link-provider.js:17:89)
    at Array.reduce (native)
    at IssueLinkProvider.provideDocumentLinks (C:\Users\useraccount\.vscode\extensions\gioboa.jira-plugin-0.2.0\out\src\shared\document-link-provider.js:17:14)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:728:876
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:109:515
    at new n.Class.derive._oncancel (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:84:560)
    at Object.t.asWinJsPromise (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:109:478)
    at e.provideLinks (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:728:830)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:739:338
    at e._withAdapter (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:731:534)
    at e.$provideDocumentLinks (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:739:300)
    at e._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:658:87)
    at e._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:657:779)
    at e._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:656:851)
    at e._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:656:620)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:655:544
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:658:673
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:96:599
    at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:97:917)
    at u (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:159:721)
    at Socket.<anonymous> (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:159:898)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)
gioboa commented 6 years ago

Thanks for your notice, the right way for me it's add a command for import JIRA cert into the VS Code certificate store. I add this feature for the next release. :+1:

deftdawg commented 6 years ago

I wouldn't spend too much effort on this as it will likely get fixed upstream in Microsoft/vscode#52880

gioboa commented 6 years ago

Issue Microsoft/vscode#52880 will resolve the problem