microsoft / azure-devops-intellij

IntelliJ IDEA plug-in for Visual Studio Team Services and Team Foundation Server (TFS)
MIT License
151 stars 95 forks source link

Azure Devops Services signup fails #259

Open JG127 opened 4 years ago

JG127 commented 4 years ago

The dialog "Checkout from Azure Dev Services" hangs when clicking the "Sign in" label. I suppose because it encountered the exception underneath. Logically a Microsoft oauth dialog should pop up. In this case it doesn't.

The cause of course are the MITM measures on my employer's network. The certificates are generated on the spot by the firewall and not recognized by the software.

PyCharm solved this by showing a dialog asking the user if the certificate should be accepted. I propose the authors of this plugin should do the same.

java.lang.Error: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at com.microsoft.alm.auth.oauth.OAuth2Authenticator.getAzureAuthority(OAuth2Authenticator.java:300) at com.microsoft.alm.auth.oauth.OAuth2Authenticator.access$300(OAuth2Authenticator.java:32) at com.microsoft.alm.auth.oauth.OAuth2Authenticator$1.doRetrieve(OAuth2Authenticator.java:245) at com.microsoft.alm.auth.oauth.OAuth2Authenticator$1.doRetrieve(OAuth2Authenticator.java:168) at com.microsoft.alm.auth.BaseAuthenticator$SecretRetriever.retrieve(BaseAuthenticator.java:268) at com.microsoft.alm.auth.oauth.OAuth2Authenticator.getOAuth2TokenPair(OAuth2Authenticator.java:284) at com.microsoft.alm.plugin.authentication.facades.VsoAuthInfoProvider.getAuthenticationInfoAsync(VsoAuthInfoProvider.java:92) at com.microsoft.alm.plugin.authentication.VsoAuthenticationProvider.authenticateAsync(VsoAuthenticationProvider.java:69) at com.microsoft.alm.plugin.idea.common.ui.common.LookupHelper.authenticateAndLoadVsoContexts(LookupHelper.java:158) at com.microsoft.alm.plugin.idea.common.ui.checkout.VsoCheckoutPageModel.loadRepositories(VsoCheckoutPageModel.java:79) at com.microsoft.alm.plugin.idea.common.ui.checkout.CheckoutPageController.actionPerformed(CheckoutPageController.java:92) at com.microsoft.alm.plugin.idea.common.ui.controls.Hyperlink.notifyActionListeners(Hyperlink.java:91) at com.microsoft.alm.plugin.idea.common.ui.controls.Hyperlink.access$000(Hyperlink.java:25) at com.microsoft.alm.plugin.idea.common.ui.controls.Hyperlink$1.linkSelected(Hyperlink.java:35) at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:142) at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:356) at com.intellij.ui.components.labels.LinkLabel$MyMouseHandler.mouseReleased(LinkLabel.java:330) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342) at java.desktop/java.awt.Component.processEvent(Component.java:6416) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:878) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:823) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:466) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:693) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:465) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117) at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233) at java.desktop/java.awt.Dialog.show(Dialog.java:1063) at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:707) at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:432) at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1685) at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1644) at com.intellij.openapi.ui.DialogWrapper.showAndGet(DialogWrapper.java:1658) at com.microsoft.alm.plugin.idea.common.ui.common.BaseDialogImpl.showModalDialog(BaseDialogImpl.java:185) at com.microsoft.alm.plugin.idea.common.ui.checkout.CheckoutController.showModalDialog(CheckoutController.java:75) at com.microsoft.alm.plugin.idea.git.extensions.GitCheckoutProvider.doCheckout(GitCheckoutProvider.java:39) at com.intellij.openapi.vcs.checkout.CheckoutAction.actionPerformed(CheckoutAction.java:29) at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:265) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:282) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:256) at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:200) at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:190) at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$2(ActionPopupStep.java:184) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:192) at com.intellij.ui.popup.AbstractPopup.lambda$dispose$13(AbstractPopup.java:1428) at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2464) at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:222) at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:174) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:161) at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1424) at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:162) at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:318) at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.dispose(PopupFactoryImpl.java:278) at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:47) at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:43) at com.intellij.openapi.util.objectTree.ObjectNode$1.execute(ObjectNode.java:135) at com.intellij.openapi.util.objectTree.ObjectNode$1.execute(ObjectNode.java:104) at com.intellij.openapi.util.objectTree.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:194) at com.intellij.openapi.util.objectTree.ObjectNode.execute(ObjectNode.java:104) at com.intellij.openapi.util.objectTree.ObjectTree.executeAll(ObjectTree.java:142) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:136) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:132) at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:263) at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:453) at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:407) at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:353) at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.handleSelect(PopupFactoryImpl.java:298) at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:512) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342) at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:566) at java.desktop/java.awt.Component.processEvent(Component.java:6416) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:878) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:823) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:466) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:465) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:320) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:263) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:258) at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:641) at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:460) at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:360) at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:421) at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:177) at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:168) at com.microsoft.alm.helpers.HttpClientImpl.head(HttpClientImpl.java:106) at com.microsoft.alm.helpers.HttpClientImpl.getHeaderField(HttpClientImpl.java:127) at com.microsoft.alm.helpers.HttpClientImpl.getHeaderField(HttpClientImpl.java:118) at com.microsoft.alm.auth.oauth.AzureAuthority.detectTenantId(AzureAuthority.java:188) at com.microsoft.alm.auth.oauth.helper.AzureAuthorityProvider.getAzureAuthority(AzureAuthorityProvider.java:27) at com.microsoft.alm.auth.oauth.OAuth2Authenticator.getAzureAuthority(OAuth2Authenticator.java:298) ... 131 more Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385) at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:290) at java.base/sun.security.validator.Validator.validate(Validator.java:264) at java.base/sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313) at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:222) at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:129) at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:625) ... 150 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380) ... 156 more

ForNeVeR commented 4 years ago

Hello. Which version of the plugin are you using? The latest one should use the same algorithm as PyCharm: it should ask you whether you trust the certificate.

JG127 commented 4 years ago

I've installed yesterday 1.157.0

PyCharm 2019.2.5 (Professional Edition) Build #PY-192.7142.56, built on November 19, 2019

JG127 commented 4 years ago

I don't know if it related, but when I restart PyCharm it loses track of the Azure Dev association. And It can't be resumed because it only wants to create a new Git repository, not reuse an existing one. This is a major issue.

ForNeVeR commented 4 years ago

What is the "Azure Dev association"? Could you please post steps you're performing to reproduce the issue? With related screenshots, if possible. Thanks!

luedi commented 4 years ago

I have exact the same problem. I have installed version 1.161.0 into Rider 2020.2. My company's firewall breaks up SSL connections for checking for spam and malware.