Ok, I have a java 6 project , in mac high sierra, project with a mongo dependency.
repositories {
mavenCentral()
}
dependencies {
compile 'org.mongodb:mongo-java-driver:2.14.3'
}
I get an ssl error when building it using gradle as follows:
FAILURE: Build failed with an exception.
- What went wrong:
Could not resolve all dependencies for configuration ':runtime'.
Could not resolve org.mongodb:mongo-java-driver:2.14.3. Required by: :buildSrc:unspecified Could not GET 'https://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/2.14.3/mongo-java-driver-2.14.3.pom'. peer not authenticated
org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':runtime'. ...
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/2.14.3/mongo-java-driver-2.14.3.pom'. ...
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
I tried importing the security certificate into the cacerts but this didn't do it.
#from /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home//lib/security/
openssl s_client -showcerts -connect repo1.maven.org:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >mavencert.pem
# from ~
$JAVA_HOME/bin/keytool -import -alias mavencert -keystore cacerts -file $JAVA_HOME/lib/security/mavencert.pem
# enter password: changeit
Upgrading to a never version of java is not a posiblity. Please help.