microsoft / azure-devops-intellij

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

Connecting Rider to TFVC on TFS, via direct access #369

Open stefanelll123 opened 4 years ago

stefanelll123 commented 4 years ago

Hi! Currently I am working from home and I am trying to use Rider to connect to TFS. While I was in the office everything works fine, but know, because I use Direct access to connect to TFS I cannot use Rider anymore, because the extension doesn't work.

I took a look in the logs and I see this exception:

java.lang.RuntimeException: An error occurred: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at com.microsoft.alm.plugin.external.commands.Command.throwIfError(Command.java:423) at com.microsoft.alm.plugin.external.commands.FindWorkspaceCommand.throwIfError(FindWorkspaceCommand.java:132) at com.microsoft.alm.plugin.external.commands.FindWorkspaceCommand.parseOutput(FindWorkspaceCommand.java:88) at com.microsoft.alm.plugin.external.commands.FindWorkspaceCommand.parseOutput(FindWorkspaceCommand.java:24) at com.microsoft.alm.plugin.external.commands.Command$1.completed(Command.java:178) at com.microsoft.alm.plugin.external.ToolRunner$ListenerProxy.completed(ToolRunner.java:295) at com.microsoft.alm.plugin.external.ToolRunner$ProcessWaiter.run(ToolRunner.java:333)

ForNeVeR commented 4 years ago

Hello. First of all, what's "direct access"?

From the error message, it looks like you should set up a certificate for the external TFVC client to use (which process, unfortunately, is documented very poorly; we have plans to enhance it). To do it, you could follow this comment.

Please let us know how it goes.

eldamir commented 2 years ago

I'm getting this same error now in 2022 and I'm not sure what is going on...

modmoto commented 2 years ago

here aswell

eldamir commented 2 years ago

Since OP isn't chiming in, I'll hijack a bit... @ForNeVeR , this is what I am seeing. Can you make sense of it?

image

image

image

ForNeVeR commented 2 years ago

In that case, it's clear you need to do something about the certificates the TFS client is using. Take a look at #50.

eldamir commented 2 years ago

I follow all the tips in #50 to no avail... Particularly here:

You can find it in the IntelliJ IDEA install folder, which in my case is C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3.1\jre\jre\bin.

Once there you will then execute the following command

keytool -keystore "C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3.1\jre\jre\lib\security\cacerts" -importcert -alias TFS -file "C:\temp\tfs.cer"

I've installed through Jetbrains Toolbox, and so that path doesn't exist... I found my cacerts here:

And then I'm assuming that the correct JRE is here, but I may be wrong:

Actually, hang on, There is also a Rider-specific set here:

Running the -importcert with these made the difference... Now it works...!

Thanks for being my Rubber Duck, @ForNeVeR

achille1789 commented 1 year ago

Hi, here it is I solved on Mac M1 based on the https://github.com/microsoft/azure-devops-intellij/issues/50 answer:

  1. I connected to Azure Devops Sever and exported the certificate .cer from the browser
  2. I downloaded and installed Java 8 to be able to use keytool https://www.java.com/en/download/
  3. opened /Applications/Rider.app/Contents/jbr/Contents/Home/lib/security
  4. ran: keytool -keystore cacerts -importcert -alias TFS -file "path_for_your_certificate.cer"
  5. typed password: changeit
  6. checked out the repo using TFVC