GitLab LDAP verifying certs despite it not being set

We have just upgraded to 9.4.2, EE.

People trying to use git over https make a 500 error. People using git over SSH and people logging in on the web browser don't.

The error log shows:

Completed 500 Internal Server Error in 16ms (ActiveRecord: 2.1ms | Elasticsearch: 0.0ms)

Net::LDAP::Error (SSL_connect returned=1 errno=0 state=error: certificate verify failed):
  lib/gitlab/ldap/authentication.rb:37:in `login'
  lib/gitlab/ldap/authentication.rb:18:in `block in login'
  lib/gitlab/ldap/authentication.rb:16:in `each'
  lib/gitlab/ldap/authentication.rb:16:in `find'
  lib/gitlab/ldap/authentication.rb:16:in `login'
  lib/gitlab/auth.rb:62:in `block in find_with_user_password'
  lib/gitlab/auth/unique_ips_limiter.rb:17:in `limit_user!'
  lib/gitlab/auth.rb:53:in `find_with_user_password'
  lib/ee/gitlab/auth.rb:10:in `find_with_user_password'
  lib/gitlab/auth.rb:111:in `user_with_password_for_git'
  lib/gitlab/auth.rb:36:in `find_for_git_client'
  app/controllers/projects/git_http_client_controller.rb:98:in `handle_basic_authentication'
  app/controllers/projects/git_http_client_controller.rb:34:in `authenticate_user'
Assignee Loading
Time tracking Loading