繁体   English   中英

将自签名https证书添加到teamcity后,TeamCity构建代理将断开连接

[英]TeamCity build agent becomes disconnected after adding self-signed https certificate to teamcity

我向我的Teamcity BuildServer添加了一个自签名证书,以引入https支持,以便现在可以访问它

https://ServerUrl:8443

(更多细节如何在这里

结果是我能够通过https访问服务器,但我的构建代理现在已断开连接。 如何解决这个问题?

构建代理充当构建服务器的客户端并使用http / https与其进行通信,结果发现当您添加自签名证书时,构建代理不接受它。

我需要

  1. 让构建代理知道与服务器通信的新路径
  2. 让构建代理知道它可以信任自签名证书

要更改路径,我执行了以下操作(有关详细信息,请参阅此帖子

找到文件:
$ TEAMCITY_HOME / buildAgent / conf目录/ buildAgent.properties

改变财产
serverUrl = http:\\:// localhost \\:8080到你的新网址

为了让构建代理知道它可以信任新证书,我必须将其导入构建代理的密钥存储区。这是使用keytool完成的:

keytool -importcert -file <cert file>  
        -keystore <agent installation path>/jre/lib/security/cacerts

除非你更改了它,密钥库受密码保护:changeit

在TeamCity的团队描述了稍微细节这个过程在这里

注意
如果需要从TeamCity构建服务器密钥库中检索证书,还可以使用keytool执行此操作

keytool -export -alias <alias name>  
        -file <certificate file name> 
        -keystore <Teamcity keystore path>

以下是keytool上TeamCity v8文档的链接

我在Windows Build Agent上执行此操作,并在我的Amazon Linux Build Server上拥有自签名SSL证书。 以下是我采取的步骤:

  1. 在Build Agent上建立服务器,即https://teamcity.example.com
  2. 单击URL中的证书错误并将证书下载到本地计算机
  3. 将证书从Windows中的证书资源管理器导出到cer文件中。
  4. 完全按照文档中的规定使用keytool

     > keytool -importcert -file <cert file where it was exported to> -keystore <path to JRE installation>/lib/security/cacerts password: changeit 
  5. 重新启动构建代理和中提琴!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM