Setting up TeamCity with my own GIT Server over SSL

爷,独闯天下 提交于 2019-12-09 13:01:56

问题


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?


回答1:


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.




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/21127793/setting-up-teamcity-with-my-own-git-server-over-ssl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!