Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

peer not authenticated error when downloading with gradle 2.10 #423

Closed
grote opened this issue Feb 8, 2016 · 19 comments
Closed

peer not authenticated error when downloading with gradle 2.10 #423

grote opened this issue Feb 8, 2016 · 19 comments

Comments

@grote
Copy link

grote commented Feb 8, 2016

When trying to get a jitpack hosted dependency via gradle, I receive this error:

      > Could not resolve com.github.MKergall.osmbonuspack:OSMBonusPack:v5.7.
         > Could not get resource 'https://jitpack.io/com/github/MKergall/osmbonuspack/OSMBonusPack/v5.7/OSMBonusPack-v5.7.pom'.
            > Could not GET 'https://jitpack.io/com/github/MKergall/osmbonuspack/OSMBonusPack/v5.7/OSMBonusPack-v5.7.pom'.
               > peer not authenticated

When adding the parameter -Djavax.net.debug=ssl:handshake to the gradle call, I get this more verbose description of the problem:

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

This is on Debian sid and the reason might the that JitPack's SSL certificate coming from COMODO is maybe not trusted by its java installation. Please note that I have verified that my java trust store at /etc/ssl/certs/java/cacerts is not empty. I even rebuilt it running:

sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure

However, wget and browsers validate the certificate just fine. So the error might actually not be with JitPack. I am posting it here anyway since it directly affects your main feature.

@jitpack-io
Copy link
Member

Hi @grote

Thank you so much for the detailed analysis! There used to this kind of issue with SNI SSL certificates but jitpack.io is no longer using that so its strange to see it.
What is your environment OS/JDK/Gradle and proxy if any? Tried to get your dependency with gradle and could get it.

@grote
Copy link
Author

grote commented Feb 9, 2016

I can get the dependency just fine with wget and the browser as well, just Java does not validate the certificate. I am using Debian Sid. Java is:

OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

I am using Gradle 2.10 and no proxy. The issue seems to also exist with "Arch Linux x86_64 and openjdk 7" as per #424.

@grote grote changed the title peer not authenticated error when downloading with gradle peer not authenticated error when downloading with gradle 2.10 Feb 9, 2016
@grote
Copy link
Author

grote commented Feb 9, 2016

Using Gradle 2.11 instead of 2.10 indeed solves this issue. Thanks for the idea!

@mvdan
Copy link

mvdan commented Feb 15, 2016

Oh wow, this has been driving me crazy for the past week. Thanks @grote for saving me once again.

@Ashish-Bansal
Copy link

Thanks a lot @grote for the solution!

flibbertigibbet added a commit to flibbertigibbet/DRIVER that referenced this issue Feb 17, 2016
Peer authentication to jitpack.io fails with JDK 7 / Gradle 2.10 (jitpack/jitpack.io#423).
flibbertigibbet added a commit to flibbertigibbet/DRIVER that referenced this issue Feb 18, 2016
Peer authentication to jitpack.io fails with JDK 7 / Gradle 2.10 (jitpack/jitpack.io#423).
flibbertigibbet added a commit to flibbertigibbet/DRIVER that referenced this issue Feb 20, 2016
Peer authentication to jitpack.io fails with JDK 7 / Gradle 2.10 (jitpack/jitpack.io#423).
@mattbillenstein
Copy link

Having the same issue in Maven -- does anyone understand what the nature of the fix in Gradle was?

@aandis
Copy link

aandis commented Mar 4, 2016

+1
thanks @grote!

flibbertigibbet added a commit to flibbertigibbet/DRIVER-Android that referenced this issue Mar 14, 2016
Must upgrade gradle to work around jitpack/jitpack.io#423.
@dtracers
Copy link

dtracers commented Apr 9, 2016

I would like to say that I have the same issue with maven using 3.0.2 on ubuntu. This was fixed by updating to the latest version of maven.

@jitpack-io
Copy link
Member

@dtracers Thank you for the information!

@gabteles
Copy link

Updating to gradle 2.11 also worked for me! 👍

@Kapil-Yadav
Copy link

updating to 2.11 worked for me too , thanks a lot

@jguix
Copy link

jguix commented May 27, 2016

Got this message building a project on PhoneGap Build. My project uses a Cordova plugin which I developed myself and use in other Cordova projects. The problem only raises in PhoneGap Build.

* What went wrong:
A problem occurred configuring root project 'project'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not resolve com.github.50ButtonsEach:fliclib-android:ec1cdc3fbe.
     Required by:
         :project:unspecified
      > Could not GET 'https://jitpack.io/com/github/50ButtonsEach/fliclib-android/ec1cdc3fbe/fliclib-android-ec1cdc3fbe.pom'.
         > peer not authenticated

The plugin that I am uisng in my app is Cordova-Flic:
https://github.com/jguix/Cordova-Flic

@jitpack-io
Copy link
Member

jitpack-io commented May 27, 2016

Hi @jguix

Which version of Gradle are you using? This issue should have been fixed in 2.10
#514

@jguix
Copy link

jguix commented May 27, 2016

I'm trying to figure it out. I don't know because it is a cloud build
(PhoneGap Build), out of my control. I asked in their community forums and
I'm waiting for a response.
El 27 may. 2016 12:34 p. m., "JitPack.io" notifications@github.com
escribió:

Hi

Which version of Gradle are you using? This issue should have been fixed
in 2.10
#514 #514


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#423 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AB0GGY-_BCPREeBwUQMgS3_SfDksEgxWks5qFsi_gaJpZM4HVzVc
.

@therajanmaurya
Copy link

thanks @grote.

@lkv1988
Copy link

lkv1988 commented Jun 13, 2017

change jcenter() to this:
jcenter { url "http://jcenter.bintray.com/" }

this works for me.

@Sovietaced
Copy link

change jcenter() to this:
jcenter { url "http://jcenter.bintray.com/" }

this works for me.

Not much of a fix. You're just turning off SSL.

@lkv1988
Copy link

lkv1988 commented Mar 19, 2021

change jcenter() to this:
jcenter { url "http://jcenter.bintray.com/" }
this works for me.

Not much of a fix. You're just turning off SSL.

Yes, it's not the right solution.

@ductridev
Copy link

ductridev commented Jan 6, 2022

I found a solution that worked for me that add this into your gradle.properties.

Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2
JAVA_TOOL_OPTIONS=-Dhttps.protocols=TLSv1.2
systemProp.http.proxyHost=fodev.org
systemProp.http.proxyPort=8118
systemProp.http.nonProxyHosts=*.jitpack.io, *.maven.org
systemProp.https.proxyHost=fodev.org
systemProp.https.proxyPort=8118
systemProp.https.nonProxyHosts=*.jitpack.io, *.maven.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests