If Perforce server uses SSL-encrypted connection, adding a Perforce VCS Root on a Windows-based TeamCity server running as a services using SYSTEM account may result in the error below.
p4 error: "The authenticity of '172.20.186.72:1666' can't be established,
this may be your first attempt to connect to this P4PORT.
The fingerprint for the key sent to your client is
To allow connection use the 'p4 trust' command." - while running "p4 -u Anatoly.Cherenkov -p ssl:172.20.186.72:1666 stream -o -v //mydepot/perforceLinuxMain"
The account used to start TeamCity service does not have the Perforce server's SSL certificate fingerprint in its
p4trust.txt file. The error might persist even after you use
p4 trust command if TeamCity is using a different account from the one using which the command is run.
Add the perforce port and SSL fingerprint into
p4trust.txt file under the
%USERPROFILE% folder of TeamCity account. File content example:
If SYSTEM account is used to start TeamCity service, the
%USERPROFILE% folder is