title: Connect to gitlab using Java's Gitlab API
body: <p>I want to identify which modified files and branch are related to a specific hash code. So, I am trying to use the Java's GitLabAPI (<a href="http://github.com/timols/java-gitlab-api" rel="nofollow noreferrer">Java's Gitlab API</a>) for this.</p>
  <p><strong>My question is</strong> Which path to use to make this implementation.</p>
  <p>I took a look on the Internet and tried connect me with repository like this:</p>
  <pre><code>GitlabSession session = GitlabAPI.connect(host, &quot;user&quot;, &quot;key&quot;);
  GitlabAPI api = GitlabAPI.connect(host, session.getPrivateToken());
  </code></pre>
  <p>However, the following error occurred:</p>
  <pre><code>16:03:17,080 ERROR [STDERR] java.net.SocketException: Connection reset
  16:03:17,081 ERROR [STDERR]     at java.net.SocketInputStream.read(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
  16:03:17,081 ERROR [STDERR]     at org.gitlab.api.http.GitlabHTTPRequestor.submitData(GitlabHTTPRequestor.java:339)
  16:03:17,081 ERROR [STDERR]     at org.gitlab.api.http.GitlabHTTPRequestor.to(GitlabHTTPRequestor.java:160)
  16:03:17,081 ERROR [STDERR]     at org.gitlab.api.http.GitlabHTTPRequestor.to(GitlabHTTPRequestor.java:139)
  16:03:17,081 ERROR [STDERR]     at org.gitlab.api.GitlabAPI.connect(GitlabAPI.java:54)
  </code></pre>
  <p>What do I have to do to get connected to the repository?</p>