Perform a test connection to the host over HTTPS. Replace
HOSTNAME
with your GitLab URL
(excluding HTTPS), and replace
port
with the port that serves HTTPS connections (usually 443):
The
echo
command sends a null request to the server, causing it to close the connection rather
than wait for additional input. You can use the same command to test remote hosts (for example, a
server hosting an external repository), by replacing
HOSTNAME:port
with the remote host’s domain
and port number.
This command’s output shows you the certificate chain, any public certificates the server
presents, along with validation or connection errors if they occur. This makes for a quick check
for any immediate issues with your SSL settings.
View a certificate’s details in text form using
x509
. Be sure to replace
/path/to/certificate.crt
with the certificate’s path:
For example, GitLab automatically fetches and places certificates acquired from Let’s Encrypt at
/etc/gitlab/ssl/hostname.crt
. You can use the
x509
command with that path to quickly display
the certificate’s information (for example, the hostname, issuer, validity period, and more).
It is recommended to use the full certificate chain in order to prevent SSL errors when clients connect. The full certificate chain order should consist of the server certificate first, followed by all intermediate certificates, with the root CA last.
unable to verify the first certificate
This error indicates that an incomplete certificate chain is being presented by the server. To fix this error, you will need to
replace server’s certificate with the full chained certificate
. The full certificate chain order should consist of the server certificate first, followed by all intermediate certificates, with the root CA last.
certificate signed by unknown authority
This error indicates that the client does not trust the certificate or CA. To fix this error, the client connecting to server will need to
trust the certificate or CA
.
SSL certificate problem: self signed certificate in certificate chain
This error indicates that the client does not trust the certificate or CA. To fix this error, the client connecting to server will need to
trust the certificate or CA
.
x509: certificate relies on legacy Common Name field, use SANs instead
This error indicates that
SANs
(subjectAltName) must be configured in the certificate. For more information, see
this issue
.
Git-LFS and other embedded services written in
golang
report custom certificate signed by unknown authority
Your domain’s Certification Authority Authorization (CAA) record does not allow Let’s Encrypt to issue a certificate for your domain. Look for the following error in the reconfigure output:
letsencrypt_certificate[gitlab.domain.net] (letsencrypt::http_authorization line 5) had an error: RuntimeError: acme_certificate[staging] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certificate.rb line 25) had an error: RuntimeError: ruby_block[create certificate for gitlab.domain.net] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/acme/resources/certificate.rb line 108) had an error: RuntimeError: [gitlab.domain.com] Validation failed, unable to request certificate
If you’re using a test domain such as gitlab.example.com, without a certificate, you’ll see the unable to request certificate error shown above. In that case, disable Let’s Encrypt by setting letsencrypt['enable'] = false in /etc/gitlab/gitlab.rb.
You can test your domain using the
Let’s Debug
diagnostic tool. It can help you figure out why you can’t issue a Let’s Encrypt certificate.
Dec 6 02:43:17 runner-host01 gitlab-runner[15131]: #033[0;33mWARNING: Checking for jobs... failed#033[0;m #033[0;33mrunner#033[0;m=Bfkz1fyb #033[0;33mstatus#033[0;m=couldn't execute POST against
https://gitlab.domain.tld/api/v4/jobs/request: Post https://gitlab.domain.tld/api/v4/jobs/request:
x509: certificate signed by unknown authority
Add the self-signed certificate from the remote GitLab instance to the
/etc/gitlab/trusted-certs
directory on the local GitLab instance, and then
run
sudo gitlab-ctl reconfigure
as per the instructions for
installing custom public certificates
.
You may also get another error message when trying to mirror a repository from
a remote GitLab instance that uses a self-signed certificate:
2:Fetching remote upstream failed: fatal: unable to access 'https://gitlab.domain.tld/root/test-repo/':
SSL: unable to obtain common name from peer certificate
In this case, the problem can be related to the certificate itself:
Validate that your self-signed certificate isn’t missing a common name. If it
is, regenerate a valid certificate
Add the certificate to
/etc/gitlab/trusted-certs
.
Run
sudo gitlab-ctl reconfigure
.
Unable to perform Git operations due to an internal or self-signed certificate
Proceed with caution when
ignoring SSL
due to the potential security issues associated with disabling this option at global level. Use this option
only
when troubleshooting, and reinstate SSL verification immediately after.
git config --global http.sslVerify false
Docs
Edit this page
to fix an error or add an improvement in a merge request. Create an issue
to suggest an improvement to this page.
View pricing
to see all GitLab tiers and features, or to upgrade. Try GitLab for free
with access to all features for 30 days.
Get Help
If you didn't find what you were looking for,
search the docs.
If you want help with something specific and could use community support,
post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab
subscription).