Commit 0f57aaaa authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'gh-import-ssl-verification' into 'master'

Allow OAuth SSL verification to be disabled when importing from GitHub

Close https://gitlab.com/gitlab-org/gitlab-ee/issues/457

The SSL verification should be disabled if the GitHub Enterprise use a self signed certificate. Even disabling this on GitLab, the Git client installed in the server will perform the verification and stop the process if it is unknown. So, we need to disable Git SSL verification in the server hosting `GitLab` with the following command:

```
$ git config --global http.sslVerify false
```

/cc @balameb @ernstvn 

See merge request !323
parents e3d66bd0 7d94a142
...@@ -7,7 +7,7 @@ module Gitlab ...@@ -7,7 +7,7 @@ module Gitlab
@client = ::OAuth2::Client.new( @client = ::OAuth2::Client.new(
config.app_id, config.app_id,
config.app_secret, config.app_secret,
github_options github_options.merge(ssl: { verify: config['verify_ssl'] })
) )
if access_token if access_token
......
...@@ -26,6 +26,7 @@ describe Gitlab::GithubImport::Client, lib: true do ...@@ -26,6 +26,7 @@ describe Gitlab::GithubImport::Client, lib: true do
end end
it 'uses supplied value' do it 'uses supplied value' do
expect(client.client.options[:connection_opts][:ssl]).to eq({ verify: false })
expect(client.api.connection_options[:ssl]).to eq({ verify: false }) expect(client.api.connection_options[:ssl]).to eq({ verify: false })
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment