Connection reset on Gitlab Mattermost + Gitlab SSO

I have set up Gitlab Mattermost (with just Mattermost service enabled) on one machine and a regular Gitlab on another machine. Both hjave HTTPS enabled and are configured to use letsencrypt certificates. They seem to be working mostly fine, except when on Mattermost I try to use Gitlab’s SSO. The moment when I click the button to request the Authorization I get an empty response from Gitlab Mattermost, and its log file shows this:

[2017/07/19 07:30:51 UTC] [EROR] /signup/gitlab/complete:AuthorizeOAuthUser code=500 rid=w6tquosdftbfmf69k15ntkjgwo uid= ip=192.168.1.1 Token request failed [details: Post https://[REDACTED]/oauth/token: read tcp 192.168.1.2:47946->[REDACTED]:443: read: connection reset by peer]

Anyone has any idea what is the cause of this issue?

Hi @botherder,

Is there anything showing up in GitLab’s logs? Perhaps that would give a better idea of why it’s not connecting properly. If you’re using the GitLab omnibus, the one you’re looking for is likely in /var/log/gitlab/gitlab-rails/production.log.

There is nothing besides the log for redirection.
The Mattermost log only shows the connection reset error followed by an Invalid state token error. I can’t find anything else.

Is there a firewall or anything in between your two server? Perhaps the connection is getting stopped by something in between them if GitLab isn’t logging anything