Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up TeamCity with my own GIT Server over SSL

I have my own GIT server repository and can be connected via HTTPS protocol.

I am trying to setup TeamCity to connect to my GIT repo but I am unable to because of the HTTPS protocol.

In Eclipse, I have a setting that sets sslVerify=false and I can connect to my GIT repo and perform my task.

How can i achieve the same for TeamCity?

like image 731
user3169403 Avatar asked Jan 15 '14 01:01

user3169403


3 Answers

As issue TW-30210 illustrates, it can depends on the version of TeamCity and Java you are using.

It also depends if your certificate is self-signed or not.
If is is signed (and validate by an actual CA - Certificate Authority), then you need to add it in your java keystore (used by TeamCity): see "Using HTTPS to access TeamCity server".

If you just want to disable ssl verification, you can do on the TeamCity server:

  • for git commands, and
  • for the java you are using to run the TeamCity server.

    -Dcom.sun.net.ssl.checkRevocation=false
    

But that is considered as a bad practice.

like image 120
VonC Avatar answered Sep 22 '22 04:09

VonC


Addition for answer above with samples for default setup:

openssl s_client -connect <githost>:443 </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /opt/exported.cert
keytool -import -noprompt -trustcacerts -alias <githost> -file /opt/exported.cert -keystore ${JAVA_HOME}/jre/lib/security/cacerts -storepass changeit

Where,

githost - domain name of host with git repo

like image 22
Reishin Avatar answered Sep 18 '22 04:09

Reishin


We were using 32-bit version of git on teamcity server (64-bit). So removing 32-bit and installing 64-bit git bash and git cmd helped resolve the GIT and Teamcity connection problem for us. I hope this help some users.

like image 37
jitin14 Avatar answered Sep 21 '22 04:09

jitin14