Ошибка ssl certificate problem self signed certificate in certificate chain

I have upgraded my Inteliij IDEA 2019.2 recently and I am getting the following error if I try to pull from using my IDE:

Git Pull Failed: unable to access ‘https://github.xxx.com/app-Hello-USD/DGS.git/’: SSL certificate problem: self signed certificate in certificate chain.

Could someone help me what option I have to enable?

Gino Mempin's user avatar

Gino Mempin

24.8k28 gold badges92 silver badges130 bronze badges

asked Aug 2, 2019 at 13:35

user3123934's user avatar

1

git config --global http.sslVerify false

answered Aug 2, 2019 at 21:42

CrazyCoder's user avatar

CrazyCoderCrazyCoder

387k170 gold badges984 silver badges897 bronze badges

7

We can use Windows certificate storage mechanism.

Please try this

git config --global http.sslbackend schannel

Gino Mempin's user avatar

Gino Mempin

24.8k28 gold badges92 silver badges130 bronze badges

answered Sep 15, 2022 at 14:25

Kyu Lee's user avatar

Kyu LeeKyu Lee

2713 silver badges4 bronze badges

4

This usually happens when your Git repository server is hosted inside a private network and uses a locally generated (self signed) TLS certificate. Because this certificate is not from a «trusted» source, most software will complain that the connection is not secure.

So you need to disable SSL verification on Git to clone the repository and immediately enable it again, otherwise Git will not verify certificate signatures for any other repository.

  1. Disable SSL verification on Git globally:
    git config --global http.sslVerify false
    
  2. Clone your repository:
    git clone <your repo>
    
  3. Enable SSL verification on Git globally:
    git config --global http.sslVerify true
    
  4. Change directory into your repo:
    cd <your repo>
    
  5. Disable SSL verification only on your repository:
    git config --local http.sslVerify false
    

In the first step, when turning off SSL verification, if you’re getting this error:

warning: http.sslverify has multiple values
error: cannot overwrite multiple values with a single value
       Use a regexp, --add or --replace-all to change http.sslVerify.

Open your .gitconfig file and remove duplicate http.sslverify lines.

Gino Mempin's user avatar

Gino Mempin

24.8k28 gold badges92 silver badges130 bronze badges

answered Feb 23, 2022 at 11:29

bezbos.'s user avatar

bezbos.bezbos.

1,5112 gold badges17 silver badges33 bronze badges

If you want to add the self-signed cert, export the cert you want as a Base-64 encoded .CER file. Locate your Git cert.pem file (for me it is in C:Program FilesGitusrsslcert.pem). Open up your .CER file in a text-editor, and copy/paste the contents at the end of your cert.pem file. Save the file. Then open up your console and type

 git config --global http.sslCAInfo "C:Program FilesGitusrsslcert.pem"

answered Mar 16, 2022 at 16:29

codeMonkey's user avatar

codeMonkeycodeMonkey

4,0542 gold badges31 silver badges49 bronze badges

1

If you are connected to a VPN, please try without the VPN. I go this error because of this issue.

answered Jun 30, 2022 at 11:38

suranga upul's user avatar

For github.com you may change protocol from HTTPS to SSH:

  1. open .git/config

  2. fix url in [remote «origin»] block

    old: url = https://github.com/myname/proj1

    new: url = git@github.com:myname/proj1.git

answered Dec 22, 2022 at 5:03

Vladimir's user avatar

VladimirVladimir

6,0442 gold badges32 silver badges35 bronze badges

This can be fixed by disabling SSL checking in the git config for the affected repositories. This should not require elevated privileges to complete.

git config http.sslVerify "false"

This command does not require use of the --global argument.

Gino Mempin's user avatar

Gino Mempin

24.8k28 gold badges92 silver badges130 bronze badges

answered May 11, 2022 at 13:48

brethvoice's user avatar

brethvoicebrethvoice

3521 gold badge4 silver badges14 bronze badges

1

I have upgraded my Inteliij IDEA 2019.2 recently and I am getting the following error if I try to pull from using my IDE:

Git Pull Failed: unable to access ‘https://github.xxx.com/app-Hello-USD/DGS.git/’: SSL certificate problem: self signed certificate in certificate chain.

Could someone help me what option I have to enable?

Gino Mempin's user avatar

Gino Mempin

24.8k28 gold badges92 silver badges130 bronze badges

asked Aug 2, 2019 at 13:35

user3123934's user avatar

1

git config --global http.sslVerify false

answered Aug 2, 2019 at 21:42

CrazyCoder's user avatar

CrazyCoderCrazyCoder

387k170 gold badges984 silver badges897 bronze badges

7

We can use Windows certificate storage mechanism.

Please try this

git config --global http.sslbackend schannel

Gino Mempin's user avatar

Gino Mempin

24.8k28 gold badges92 silver badges130 bronze badges

answered Sep 15, 2022 at 14:25

Kyu Lee's user avatar

Kyu LeeKyu Lee

2713 silver badges4 bronze badges

4

This usually happens when your Git repository server is hosted inside a private network and uses a locally generated (self signed) TLS certificate. Because this certificate is not from a «trusted» source, most software will complain that the connection is not secure.

So you need to disable SSL verification on Git to clone the repository and immediately enable it again, otherwise Git will not verify certificate signatures for any other repository.

  1. Disable SSL verification on Git globally:
    git config --global http.sslVerify false
    
  2. Clone your repository:
    git clone <your repo>
    
  3. Enable SSL verification on Git globally:
    git config --global http.sslVerify true
    
  4. Change directory into your repo:
    cd <your repo>
    
  5. Disable SSL verification only on your repository:
    git config --local http.sslVerify false
    

In the first step, when turning off SSL verification, if you’re getting this error:

warning: http.sslverify has multiple values
error: cannot overwrite multiple values with a single value
       Use a regexp, --add or --replace-all to change http.sslVerify.

Open your .gitconfig file and remove duplicate http.sslverify lines.

Gino Mempin's user avatar

Gino Mempin

24.8k28 gold badges92 silver badges130 bronze badges

answered Feb 23, 2022 at 11:29

bezbos.'s user avatar

bezbos.bezbos.

1,5112 gold badges17 silver badges33 bronze badges

If you want to add the self-signed cert, export the cert you want as a Base-64 encoded .CER file. Locate your Git cert.pem file (for me it is in C:Program FilesGitusrsslcert.pem). Open up your .CER file in a text-editor, and copy/paste the contents at the end of your cert.pem file. Save the file. Then open up your console and type

 git config --global http.sslCAInfo "C:Program FilesGitusrsslcert.pem"

answered Mar 16, 2022 at 16:29

codeMonkey's user avatar

codeMonkeycodeMonkey

4,0542 gold badges31 silver badges49 bronze badges

1

If you are connected to a VPN, please try without the VPN. I go this error because of this issue.

answered Jun 30, 2022 at 11:38

suranga upul's user avatar

For github.com you may change protocol from HTTPS to SSH:

  1. open .git/config

  2. fix url in [remote «origin»] block

    old: url = https://github.com/myname/proj1

    new: url = git@github.com:myname/proj1.git

answered Dec 22, 2022 at 5:03

Vladimir's user avatar

VladimirVladimir

6,0442 gold badges32 silver badges35 bronze badges

This can be fixed by disabling SSL checking in the git config for the affected repositories. This should not require elevated privileges to complete.

git config http.sslVerify "false"

This command does not require use of the --global argument.

Gino Mempin's user avatar

Gino Mempin

24.8k28 gold badges92 silver badges130 bronze badges

answered May 11, 2022 at 13:48

brethvoice's user avatar

brethvoicebrethvoice

3521 gold badge4 silver badges14 bronze badges

1

openssl s_client  -connect www.github.com:443
CONNECTED(000001E4)
depth=1 O = AO Kaspersky Lab, CN = Kaspersky Anti-Virus Personal Root Certificate
verify error:num=19:self signed certificate in certificate chain
---
Certificate chain
 0 s:/businessCategory=Private Organization/jurisdictionC=US/jurisdictionST=Delaware/serialNumber=5157550/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com
   i:/O=AO Kaspersky Lab/CN=Kaspersky Anti-Virus Personal Root Certificate
 1 s:/O=AO Kaspersky Lab/CN=Kaspersky Anti-Virus Personal Root Certificate
   i:/O=AO Kaspersky Lab/CN=Kaspersky Anti-Virus Personal Root Certificate
---
Server certificate
-----BEGIN CERTIFICATE-----
….
-----END CERTIFICATE-----
subject=/businessCategory=Private Organization/jurisdictionC=US/jurisdictionST=Delaware/serialNumber=5157550/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com
issuer=/O=AO Kaspersky Lab/CN=Kaspersky Anti-Virus Personal Root Certificate
---
No client certificate CA names sent
Peer signing digest: SHA512
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 2418 bytes and written 434 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: A1BCEE841D4DBF172402BAF63BC9A80D560ED0FBC8F66B89E692206D3613FD7E
    Session-ID-ctx:
    Master-Key: ************************************************************************
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1527649383
    Timeout   : 300 (sec)
    Verify return code: 19 (self signed certificate in certificate chain)
---
closed`
  • Useful OpenSSL Debugging Commands
  • Common SSL errors
  • Reconfigure Fails Due to Certificates
  • Custom Certificates Missing or Skipped
  • Custom certificates not detected
  • Let’s Encrypt fails on reconfigure
  • Using an internal CA certificate with GitLab
  • X.509 key values mismatch error
  • Using GitLab Runner with a GitLab instance configured with internal CA certificate or self-signed certificate
  • Mirroring a remote GitLab repository that uses a self-signed SSL certificate
  • Unable to perform Git operations due to an internal or self-signed certificate
  • SSL_connect wrong version number
  • schannel: SEC_E_UNTRUSTED_ROOT

This page contains a list of common SSL-related errors and scenarios that you
may encounter while working with GitLab. It should serve as an addition to the
main SSL documentation:

  • Omnibus SSL Configuration.
  • Self-signed certificates or custom Certification Authorities for GitLab Runner.
  • Configure HTTPS manually.

Useful OpenSSL Debugging Commands

Sometimes it’s helpful to get a better picture of the SSL certificate chain by viewing it directly
at the source. These commands are part of the standard OpenSSL library of tools for diagnostics and
debugging.

  • 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):

    echo | /opt/gitlab/embedded/bin/openssl s_client -connect HOSTNAME:port
    

    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:

    /opt/gitlab/embedded/bin/openssl x509 -in /path/to/certificate.crt -text -noout
    

    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).

    If there’s a problem with the certificate, an error occurs.

  • Fetch a certificate from a server and decode it. This combines both of the above commands to fetch
    the server’s SSL certificate and decode it to text:

    echo | /opt/gitlab/embedded/bin/openssl s_client -connect HOSTNAME:port | /opt/gitlab/embedded/bin/openssl x509 -text -noout
    

Common SSL errors

  1. SSL certificate problem: unable to get local issuer certificate

    This error indicates the client cannot get the root CA. To fix this, you can either trust the root CA of the server you are trying to connect to on the client or modify the certificate to present the full chained certificate on the server you are trying to connect to.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Reconfigure Fails Due to Certificates

ERROR: Not a certificate: /opt/gitlab/embedded/ssl/certs/FILE. Move it from /opt/gitlab/embedded/ssl/certs to a different location and reconfigure again.

Check /opt/gitlab/embedded/ssl/certs and remove any files other than README.md that aren’t valid X.509 certificates.

Custom Certificates Missing or Skipped

GitLab versions 8.9.0, 8.9.1, and 8.9.2 all mistakenly used the
/etc/gitlab/ssl/trusted-certs/ directory. This directory is safe to remove if it
is empty. If it still contains custom certificates then move them to /etc/gitlab/trusted-certs/
and run gitlab-ctl reconfigure.

If no symlinks are created in /opt/gitlab/embedded/ssl/certs/ and you see
the message “Skipping cert.pem” after running gitlab-ctl reconfigure, that
means there may be one of four issues:

  1. The file in /etc/gitlab/trusted-certs/ is a symlink
  2. The file is not a valid PEM or DER-encoded certificate
  3. Perl is not installed on the operating system which is needed for c_rehash to properly symlink certificates
  4. The certificate contains the string TRUSTED

Test the certificate’s validity using the commands below:

/opt/gitlab/embedded/bin/openssl x509 -in /etc/gitlab/trusted-certs/example.pem -text -noout
/opt/gitlab/embedded/bin/openssl x509 -inform DER -in /etc/gitlab/trusted-certs/example.der -text -noout

Invalid certificate files produce the following output:

unable to load certificate
140663131141784:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:701:Expecting: TRUSTED CERTIFICATE

To test if c_rehash is not symlinking the certificate due to a missing perl interpreter:

$ /opt/gitlab/embedded/bin/c_rehash /etc/gitlab/trusted-certs

bash: /opt/gitlab/embedded/bin/c_rehash: /usr/bin/perl: bad interpreter: No such file or directory

If you see this message, you will need to install perl with your distribution’s package manager.

If you inspect the certificate itself, then look for the string TRUSTED:

-----BEGIN TRUSTED CERTIFICATE-----
...
-----END TRUSTED CERTIFICATE-----

If it does, like the example above, then try removing the string TRUSTED and running gitlab-ctl reconfigure again.

Custom certificates not detected

If after running gitlab-ctl reconfigure:

  1. no symlinks are created in /opt/gitlab/embedded/ssl/certs/;
  2. you have placed custom certificates in /etc/gitlab/trusted-certs/; and
  3. you do not see any skipped or symlinked custom certificate messages

You may be encountering an issue where Omnibus GitLab thinks that the custom
certificates have already been added.

To resolve, delete the trusted certificates directory hash:

rm /var/opt/gitlab/trusted-certs-directory-hash

Then run gitlab-ctl reconfigure again. The reconfigure should now detect and symlink
your custom certificates.

Let’s Encrypt Certificate signed by unknown authority

The initial implementation of Let’s Encrypt integration only used the certificate, not the full certificate chain.

Starting in 10.5.4, the full certificate chain will be used. For installs which are already using a certificate, the switchover will not happen until the renewal logic indicates the certificate is near expiration. To force it sooner, run the following

rm /etc/gitlab/ssl/HOSTNAME*
gitlab-ctl reconfigure

Where HOSTNAME is the hostname of the certificate.

Let’s Encrypt fails on reconfigure

When you reconfigure, there are common scenarios under which Let’s Encrypt may fail:

  1. Let’s Encrypt may fail if your server isn’t able to reach the Let’s Encrypt verification servers or vice versa:

    letsencrypt_certificate[gitlab.domain.com] (letsencrypt::http_authorization line 3) had an error: RuntimeError: acme_certificate[staging]  (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certificate.rb line 20) had an error: RuntimeError: [gitlab.domain.com] Validation failed for domain gitlab.domain.com
    

    If you run into issues reconfiguring GitLab due to Let’s Encrypt make sure you have ports 80 and 443 open and accessible.

  2. 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
    
  3. 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.

Using an internal CA certificate with GitLab

After configuring a GitLab instance with an internal CA certificate, you might
not be able to access it by using various CLI tools. You may experience the
following issues:

  • curl fails:

    curl "https://gitlab.domain.tld"
    curl: (60) SSL certificate problem: unable to get local issuer certificate
    More details here: https://curl.haxx.se/docs/sslcerts.html
    
  • Testing by using the rails console
    also fails:

    uri = URI.parse("https://gitlab.domain.tld")
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = true
    http.verify_mode = 1
    response = http.request(Net::HTTP::Get.new(uri.request_uri))
    ...
    Traceback (most recent call last):
          1: from (irb):5
    OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate))
    
  • The error SSL certificate problem: unable to get local issuer certificate
    is displayed when setting up a mirror
    from this GitLab instance.
  • openssl works when specifying the path to the certificate:

    /opt/gitlab/embedded/bin/openssl s_client -CAfile /root/my-cert.crt -connect gitlab.domain.tld:443
    

If you have the previously described issues, add your certificate to
/etc/gitlab/trusted-certs, and then run sudo gitlab-ctl reconfigure.

X.509 key values mismatch error

After configuring your instance with a certificate bundle, NGINX may display
the following error message:

SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch

This error message means that the server certificate and key you have provided
don’t match. You can confirm this by running the following command and then
comparing the output:

openssl rsa -noout -modulus -in path/to/your/.key | openssl md5
openssl x509 -noout -modulus -in path/to/your/.crt | openssl md5

The following is an example of an md5 output between a matching key and
certificate. Note the matching md5 hashes:

$ openssl rsa -noout -modulus -in private.key | openssl md5
4f49b61b25225abeb7542b29ae20e98c
$ openssl x509 -noout -modulus -in public.crt | openssl md5
4f49b61b25225abeb7542b29ae20e98c

This is an opposing output with a non-matching key and certificate which shows
different md5 hashes:

$ openssl rsa -noout -modulus -in private.key | openssl md5
d418865077299af27707b1d1fa83cd99
$ openssl x509 -noout -modulus -in public.crt | openssl md5
4f49b61b25225abeb7542b29ae20e98c

If the two outputs differ like the previous example, there’s a mismatch between
the certificate and key. Contact the provider of the SSL certificate for
further support.

Using GitLab Runner with a GitLab instance configured with internal CA certificate or self-signed certificate

Besides getting the errors mentioned in
Using an internal CA certificate with GitLab,
your CI pipelines may get stuck in Pending status. In the runner logs you may
see the following error message:

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

Follow the details in Self-signed certificates or custom Certification Authorities for GitLab Runner.

Mirroring a remote GitLab repository that uses a self-signed SSL certificate

When configuring a local GitLab instance to mirror a repository
from a remote GitLab instance that uses a self-signed certificate, you may see
the SSL certificate problem: self signed certificate error message in the
user interface.

The cause of the issue can be confirmed by checking if:

  • curl fails:

    $ curl "https://gitlab.domain.tld"
    curl: (60) SSL certificate problem: self signed certificate
    More details here: https://curl.haxx.se/docs/sslcerts.html
    
  • Testing by using the Rails console also fails:

    uri = URI.parse("https://gitlab.domain.tld")
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = true
    http.verify_mode = 1
    response = http.request(Net::HTTP::Get.new(uri.request_uri))
    ...
    Traceback (most recent call last):
          1: from (irb):5
    OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate))
    

To fix this problem:

  • 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.
  • If your local GitLab instance was installed using the Helm Charts, you can
    add your self-signed certificate to your GitLab instance.

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 &amp;#39;https://gitlab.domain.tld/root/test-repo/&amp;#39;:
SSL: unable to obtain common name from peer certificate

In this case, the problem can be related to the certificate itself:

  1. Validate that your self-signed certificate isn’t missing a common name. If it
    is, regenerate a valid certificate
  2. Add the certificate to /etc/gitlab/trusted-certs.
  3. Run sudo gitlab-ctl reconfigure.

Unable to perform Git operations due to an internal or self-signed certificate

If your GitLab instance is using a self-signed certificate, or if the
certificate is signed by an internal certificate authority (CA), you might
experience the following errors when attempting to perform Git operations:

$ git clone https://gitlab.domain.tld/group/project.git
Cloning into 'project'...
fatal: unable to access 'https://gitlab.domain.tld/group/project.git/': SSL certificate problem: self signed certificate
$ git clone https://gitlab.domain.tld/group/project.git
Cloning into 'project'...
fatal: unable to access 'https://gitlab.domain.tld/group/project.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

To fix this problem:

  • If possible, use SSH remotes for all Git operations. This is considered more
    secure and convenient to use.
  • If you must use HTTPS remotes, you can try the following:
    • Copy the self-signed certificate or the internal root CA certificate to a
      local directory (for example, ~/.ssl) and configure Git to trust your
      certificate:

      git config --global http.sslCAInfo ~/.ssl/gitlab.domain.tld.crt
      
    • Disable SSL verification in your Git client. This is intended as a
      temporary measure, as it could be considered a security risk.

      git config --global http.sslVerify false
      

SSL_connect wrong version number

A misconfiguration may result in:

  • gitlab-rails/exceptions_json.log entries containing:

    "exception.class":"Excon::Error::Socket","exception.message":"SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL::SSL::SSLError)",
    "exception.class":"Excon::Error::Socket","exception.message":"SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL::SSL::SSLError)",
    
  • gitlab-workhorse/current containing:

    http: server gave HTTP response to HTTPS client
    http: server gave HTTP response to HTTPS client
    
  • gitlab-rails/sidekiq.log or sidekiq/current containing:

    message: SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL::SSL::SSLError)
    message: SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL::SSL::SSLError)
    

Some of these errors come from the Excon Ruby gem, and could be generated in
circumstances where GitLab is configured to initiate an HTTPS session to a
remote server that is serving only HTTP.

One scenario is that you’re using object storage, which
isn’t served under HTTPS. GitLab is misconfigured and attempts a TLS handshake,
but the object storage responds with plain HTTP.

schannel: SEC_E_UNTRUSTED_ROOT

If you’re on Windows and get the following error:

Fatal: unable to access 'https://gitlab.domain.tld/group/project.git': schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted."

You must specify that Git should use OpenSSL:

git config --system http.sslbackend openssl

Alternatively, you can ignore SSL verification by running:

git config --global http.sslVerify false

Platform Notice: Cloud Only — This article only applies to Atlassian products on the cloud platform.

Summary

While performing any GIT operations, the user receives the below error message:

SSL certificate problem: self-signed certificate in certificate chain

Cause

The error message «self-signed certificate in certificate chain» usually indicates that the SSL certificate provided by the Git server you are trying to connect to is not trusted by your Git client. This can occur if the certificate is self-signed, or if it is signed by an untrusted certificate authority.

Solution

  • Configure Git to trust the self-signed certificate globally: You can configure Git to trust the self-signed certificate globally by adding an ‘http.sslCAInfo’ setting to your Git configuration file. Here’s an example of how to configure Git to trust a self-signed certificate:

    $ git config --global http.sslCAInfo /path/to/ca.pem
  • If you are using the Windows system, you may use the configuration below which sets the Secure Channel (schannel) library as the SSL backend for Git’s HTTP communication. This setting is recommended on Windows systems, as the schannel library is a part of the Windows operating system and is well-integrated with its security features. Once you have configured this, Git will use the Windows certificate store and should not require the http.sslCAInfo configuration setting.  The git config —global http.sslBackend channel setting does not bypass SSL validation. It only sets the SSL backend used by Git for its HTTP communication. The schannel library, like other SSL backends, is designed to perform SSL validation by default, which includes verifying the authenticity of the SSL certificate presented by the remote server. The schannel library is considered to be a secure SSL backend, and it supports strong encryption algorithms and certificate validation.

    git config --global http.sslBackend schannel

Last modified on Apr 3, 2023

Related content

  • No related content found

  • Ошибка ssl 61 citrix linux
  • Ошибка ssl 500 на терминале ingenico
  • Ошибка ssl 04 терминал ingenico
  • Ошибка ssh connection timed out
  • Ошибка spn 1675 fmi 5 шакман