Introduction :-
Sometimes, Users are not able to update their Bitbucket enterprise/server integrations on Terraform Cloud , and they do not see the autopopulating of git tags modules or VCS repositories over Terraform cloud .
Solution :-
Mostly If the user is using a self-signed certificate on user's Bitbucket Datacenter, the user may receive SSL certificate errors when they try to perform certain actions. This is caused by Git not trusting the certificate provided by their server.
One possible workaround is to temporarily disable SSL check for your git command in case you only need to perform a one-time clone:
GIT_SSL_NO_VERIFY=true git clone https://username@git.example.com/scm/repository.git
or
git remote add origin <gitrepo>
git config --global http.sslVerify false
Step 1: Get a self-signed certificate of the remote server
There are multiple ways of exporting the certificate, Either from the Browser or using the OpenSSL command
Get a Certificate using OpenSSL
$ echo | openssl s_client -servername NAME -connect HOST:PORT |\
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > certificate.pem
Get a Certificate using the Web browser
Step 2: Configure Git to trust the Certificate
For MAC/Linux:
Once the certificate is saved on the client you can instruct your git client to use it to trust the remote repository by updating the local git config:
# Initial clone
GIT_SSL_CAINFO=/path/to/certificate.pem
git clone https://username@git.example.com/scm/repository.git
# Ensure all future interactions with origin remote also work
cd repository
git config http.sslCAInfo /path/to/certificate.pem
Note :
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
Additional Information :-
If the above solution does not help, please open a ticket with the Terraform Cloud support team:- https://support.hashicorp.com/hc/en-us/requests/new