I am encountering an issue with Gradle when attempting to run a task on a Linux server. Despite having the correct Java and Gradle versions configured, I am getting SSL misconfiguration errors when Gradle tries to resolve plugins. Here’s a detailed breakdown of my setup and the error:
Environment:
Gradle version: 8.8
Java version: openjdk version “1.8.0_412”
Java home: Set in /etc/profile as
export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.412.b08-2.el8.x86_64
export PATH=$JAVA_HOME/bin:$PATH
build.gradle:
buildscript {
repositories {
mavenCentral()
jcenter()
flatDir {
dirs 'lib'
}
}
}
plugins {
id 'com.github.node-gradle.node' version '2.2.0'
id 'com.marklogic.ml-gradle' version '4.8.0'
}
repositories {
mavenCentral()
maven {
url 'https://developer.marklogic.com/maven2/'
}
}
configurations {
mlcp
}
dependencies {
mlcp 'com.marklogic:mlcp:10.0.9.2'
mlcp files('lib')
}
node {
version = '10.5.0'
npmVersion = '6.1.0'
download = true
}
Error when running following command
**./gradlew taskname -PmlHost=”localhost” on the linux server, getting following error : **
2024-06-07T18:10:27.221+0000 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://plugins.gradle.org:443
2024-06-07T18:10:27.224+0000 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to plugins.gradle.org/ip:443
2024-06-07T18:10:27.224+0000 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to plugins.gradle.org/ip:443 with timeout 30000
> Could not resolve com.github.node-gradle:gradle-node-plugin:2.2.0.
> Could not get resource 'https://plugins.gradle.org/m2/com/github/node-gradle/gradle-node-plugin/2.2.0/gradle-node-plugin-2.2.0.pom'.
> Could not GET 'https://plugins.gradle.org/m2/com/github/node-gradle/gradle-node-plugin/2.2.0/gradle-node-plugin-2.2.0.pom'.
> Got socket exception during request. It might be caused by SSL misconfiguration
> Connect to plugins.gradle.org:443 [plugins.gradle.org/104.16.72.101, plugins.gradle.org/104.16.73.101, plugins.gradle.org/2606:4700:0:0:0:0:6810:4865, plugins.gradle.org/2606:4700:0:0:0:0:6810:4965] failed: Network is unreachable (connect failed)
However, when I use curl to check the connection, I get a 200 OK response:
curl -I "https://plugins.gradle.org/m2/com/github/node-gradle/gradle-node-plugin/2.2.0/gradle-node-plugin-2.2.0.pom"
and same code when I am running on my local system it is work fine
There I am using java version “1.8.0_202”
Why does Gradle fail to resolve the plugin due to an SSL misconfiguration even though curl works fine? How can I resolve this SSL misconfiguration to allow Gradle to successfully connect to the plugin repository?
Any help or insights into this issue would be greatly appreciated!