-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom server certificate #41
Comments
@msnelling, solution depends on docker image platform and tool which you use to establish connection to the HTTPS host. TeamCity 2018.1 itself provides self-signed certificates management for bundled build runners: |
@dtretyakov this is for the agent to connect back to the TeamCity server over HTTPS on startup. |
@msnelling, in this case you need to populate
|
Thanks @dtretyakov, I tried the first option (my preferred) with no luck. I have the CA certificate in the directory
... but this doesn't work. I still get the error
|
@atroxaper, please take a look at the issue. |
Hello, @msnelling. At first glance, it seems that you did everything right. Please check that your certificate is stored in one of the following formats: PEM, DER or PKCS#7. For ensuring all paths are correct, you can try to do the following:
|
@msnelling Did you ever get this working? |
I'm having the exact same issue as @msnelling described. My TeamCity server is running behind nginx proxy & exposed as HTTPS. Did you manage to solve this? |
+1 , has anyone got this working ? |
for me , inside container below command execute successfully It just during agent registration i get the error
|
Alright this is what we had to do to make teamcity build agent work with https
TEAMCITY_AGENT_OPTS_ACTUAL="$TEAMCITY_AGENT_OPTS -ea $TEAMCITY_AGENT_MEM_OPTS_ACTUAL -Dteamcity_logs=$LOG_DIR/ -Djavax.net.ssl.keyStore=/data/teamcity_agent/conf/trustedCertificates/keystore.jks -Djavax.net.ssl.trustStore=/data/teamcity_agent/conf/trustedCertificates/keystore.jks -Djavax.net.ssl.keyStorePassword=changeit -Djavax.net.ssl.trustStorePassword=changeit"
COPY agent.sh /opt/buildagent/bin/agent.sh
Just to verfiy , from docker host or inside container , run ps -ef | grep java and make sure java process gets started with java keystore. |
@imlight Have you tried passing environment variable TEAMCITY_AGENT_OPTS when starting the container, like |
Thats a good suggestion, |
@kir That works like a charm mate! Cheers! |
Is this directory mean to exists ? Or do you need to create it manually ? I cannot find this on any teamcity install I have ... ? |
As far as I've found the directory does not exist. I was able to get a docker image based on jetbrains/teamcity-agent to work with a required intermediate cert by using ADD in a dockerfile: Unfortunately I can't figure out how to make this work on Windows as I'm trying to do now X:/BuildAgent/conf/trustedCertificates doesn't seem to do the trick there. And there's no JetBrains or teamcity_agent entry into the hidden ProgramData folder either 🤷♀️ EDIT: I should note that you can get this working on Windows by importing into the Java Keystore directly using the keytool, but just dropping a file in seemed cleaner and more producible via non-manual means. |
So, to summarize as I understand it: It is still not possible to use the stock containers by simply dropping a file into as of now I'm stuck in the same issue as above and what I see my evaluation of TC will fail on this :( |
Old but I just ran into the same problem. This is applicable on the Firstly, you need to grab Changes to TEAMCITY_AGENT_OPTS_ACTUAL="$TEAMCITY_AGENT_OPTS -ea $TEAMCITY_AGENT_MEM_OPTS_ACTUAL -Dteamcity_logs=$LOG_DIR/ -Djavax.net.ssl.keyStore=/opt/java/openjdk/jre/lib/security/cacerts -Djavax.net.ssl.trustStore=/opt/java/openjdk/jre/lib/security/cacerts -Djavax.net.ssl.keyStorePassword=changeit -Djavax.net.ssl.trustStorePassword=changeit" And within the
Finally, copy the cert and updated
|
There is an alternative solution that doesn't require patching Dockerfiles or images. |
It's this sort of core missing functionality that is pushing me to look for an alternative to TeamCity. It's still not simple after 5+ years. It's more and more important to make this simple, as security tools like zscaler make this a very common scenario. |
A solution that helps with almost all images except TeamCity: After launching both Docker Standalone and Docker Swarm, you can simply add Volumes |
How do we get the agent to accept successfully connect to the server using HTTPS if it is using a certificate signed by an internal/unknown CA?
Currently I'm having to connect over HTTP which is less than ideal.
The text was updated successfully, but these errors were encountered: