1

I had finally founded a solution to connect Mylyn to Gitlab's Issues in this question.

It all worked well. But a few months since I had all configured out it doesn't work anymore. I'm getting this error when trying to connect:

Invalid TLS Certificate: You can disable certificate checking by setting ignoreCertificateErrors on GitlabHTTPRequestor

Anyone know how I can get rid of this message ? There is no ignoreCertificateErrors option in the preferences neither the plugin has any such configuration ? Do I have to put somethig in the ini file ? How I set ignoreCertificateErrors ?

Edit

The commands VonC gave have worked. But now I got another error:

Unknown Exception: java.io.FileNotFoundException: https://git.company/api/v3/projects?private_token=whatever

I put this url in the browser, and got the following json:

{"error":"API V3 is no longer supported. Use API V4 instead."}

So I changed the url to:

https://git.company/api/v4/projects?private_token=whatever

and the data loaded correctly. So I guess this is a problem with the connector using an outdated api. This link:

https://github.com/pweingardt/mylyn-gitlab/issues/47

tells me I probbly will have to wait a bit. I' couldnt find any configs or files where I can change this url.

But my original question was for the TLS problem which was solved, so I'll consider the question answered by VonC.

But if someone knows how could I solve this new problem in order to really get to he end of this by connecting with the site feel free to add aditional answers.

Nelson Teixeira
  • 6,297
  • 5
  • 36
  • 73

2 Answers2

1

This is probably linked to GitLab move to GCP (Google Cloud Platform)

Try and add it to your JDK keystore (the JDK used to run your Eclipse: it could be the embedded jdk, or one on your system)

First get the new certificate:

echo -n | openssl s_client -connect git.company:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > gitlab.chain.pem

(replace git.company by your GitLab server domain name)

Then add it to your JDK

cd /path/to/jdk
jre/bin/keytool -keystore jre/lib/security/cacerts -storepass changeit -import -trustcacerts -file gitlab.chain.pem -alias NewGitLab

Launch your Eclipse again, and try your Mylyn connector.

Note: I confirm that, since GitLab 11.0 (July 2018), the API v3 is no longer supported. Only v4.
See issue 36819.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for your help. Please see my edits in the question. – Nelson Teixeira Sep 12 '18 at 20:20
  • @NelsonTeixeira Yes, I supposedthe "bad" solution would be https://www.eclipse.org/forums/index.php?t=msg&th=1085851&goto=1765694msg_1765694. Just in case, can you try https://stackoverflow.com/a/38264878/6309 first? – VonC Sep 12 '18 at 20:25
  • @NelsonTeixeira Also, check if `openssl s_client -connect gitlab.com:443` returns multiple CERTIFICATE sections: you would need to add them indivisually to your keystore: intermediate CA are important (as seen in https://stackoverflow.com/a/30807039/6309). – VonC Sep 12 '18 at 20:26
  • your commands weren't working because I copy/pasted them. But the real site was an internal gitlab instaltion in my company. When I adapted it it worked fine. – Nelson Teixeira Sep 12 '18 at 23:25
  • SO didn't allow me to award the bonus just yet (16 hours to go) ASA the period is over' Ill award it to you. – Nelson Teixeira Sep 12 '18 at 23:28
  • @NelsonTeixeira No problem. I have edited the answer to use a more generic GitLab domain name. And I have linked to the issue which removes API v3, and only use API v4. – VonC Sep 13 '18 at 06:44
1

I finally made it work. Steps:

  1. First make sure you have the JDK and maven installed in your machine, working properly and have followed the instructions VonC gave in his answer. You should install JDK BEFORE following VonC instructions.
  2. Clone this github repo: https://github.com/timols/java-gitlab-api
  3. Cd to the folder where you cloned it and run mvn clean verify. It will create a target folder with a file named java-gitlab-api-4.0.1-SNAPSHOT.jar in it.
  4. Clone this github repo: https://github.com/scriptninja/mylyn-gitlab
  5. Put the java-gitlab-api-4.0.1-SNAPSHOT.jar file in de.weingardt.mylyn.gitlab.core/lib folder.
  6. Goto to the folder where you cloned mylyn-gitlab and run mvn clean verify again
  7. When the build ends there should be a folder called de.weingardt.mylyn.gitlab.updatesite/target/repository
  8. Go to eclipe->help menu->installation details and uninstall any previous "Mylyn gitlab connectors" you had installed (if any)
  9. Go to eclipse->help menu->Install new software->Add and put <your complete folder path>/de.weingardt.mylyn.gitlab.updatesite/target/repository in the Location field. You can put anything you want in the Name field.
  10. Select the repository you just added in "Work with:" selection.
  11. An entry called "Mylyn connectors" should appear below.
  12. Install it and it's done. You can add your new working connector in Mylyn. Then just connect to the repository using the normal connection process.

If you have any problems connecting after this, check the SO link I mention my question, (this one). It has some interesting info there.

Hope it helps. Thanks to VonC for giving me the first step I needed to solve this. :)

Edit

My environment: Java 8, Ubuntu 16.04 64 bits and Eclipse Oxygen

Nelson Teixeira
  • 6,297
  • 5
  • 36
  • 73