Commit a6c11767 authored by Tim Olshansky's avatar Tim Olshansky

Merge pull request #46 from roanosullivan/master

Fixes for issues #44 and #45
parents 0dee5396 14b8c6ba
......@@ -68,12 +68,12 @@
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.9</version>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.9</version>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
......@@ -129,6 +129,20 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -341,11 +341,20 @@ public class GitlabHTTPRequestor {
}
}
};
// Added per https://github.com/timols/java-gitlab-api/issues/44
HostnameVerifier nullVerifier = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
try {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
// Added per https://github.com/timols/java-gitlab-api/issues/44
HttpsURLConnection.setDefaultHostnameVerifier(nullVerifier);
} catch (Exception e) {
// Ignore it
}
......
package org.gitlab.api.models;
import org.codehaus.jackson.annotate.JsonCreator;
public enum GitlabAccessLevel {
Guest(10),
......@@ -14,6 +15,8 @@ public enum GitlabAccessLevel {
this.accessValue = accessValue;
}
// http://fasterxml.github.io/jackson-annotations/javadoc/2.2.0/index.html?com/fasterxml/jackson/annotation/JsonCreator.html
@JsonCreator
public static GitlabAccessLevel fromAccessValue(final int accessValue) throws IllegalArgumentException {
for (final GitlabAccessLevel gitlabAccessLevel : GitlabAccessLevel.values()) {
if (gitlabAccessLevel.accessValue == accessValue) {
......
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