Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8553671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:42:21+00:00 2026-06-11T14:42:21+00:00

My Java program uses GitHub’s raw address to access a version file to get

  • 0

My Java program uses GitHub’s raw address to access a version file to get the latest version. This address is in the format https://raw.github.com/user/repository/branch/version_file

During testing stages, I had no problems using this with the following code:

currentVersion = new Version(plugin.getDescription().getVersion());

URL url = new URL("https://raw.github.com/zonedabone/CommandSigns/master/VERSION");
URLConnection connection = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
newestVersion = new Version(in.readLine());

if (currentVersion.compareTo(newestVersion) < 0)
    newAvailable = true;

However, some users have complained of the following error:

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

Java is complaining that it can’t validate the SSL certificate. GitHub’s certificate is verified by DigiCert, but apparently some Java builds won’t identify this.

I have read there are two ways to overcome this: adding the certificate to the TrustStore and disabling the validation altogether.

The answers suggested on StackOverflow either make use of an allow-all TrustStore, which would be a really bad idea considering it’s not within bounds of a ‘test environment’, or if they show how to add the certificate, they usually link to a broken web page.

Can somebody provide new information?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:42:23+00:00Added an answer on June 11, 2026 at 2:42 pm

    First the theory… As the JSSE Reference Guide says:

    IMPORTANT NOTE: The JDK ships with a limited number of trusted root
    certificates in the /lib/security/cacerts file. As
    documented in keytool, it is your responsibility to maintain (that is,
    add/remove) the certificates contained in this file if you use this
    file as a truststore.

    Depending on the certificate configuration of the servers you contact,
    you may need to add additional root certificate(s). Obtain the needed
    specific root certificate(s) from the appropriate vendor.

    Users should maintain the list of CA certificates themselves. A number of people won’t know how to do it, unfortunately. They could use another JRE’s cacerts file (more recent) into their own installation.

    You could use a trust manager that trusts any certificate and use it specifically for that connection, but that’s not a good idea, since it opens the connection to potential MITM attacks. There are enough examples of code for this insecure solution around.

    The best solution, if you want to trust a specific certificate, is to load it correctly using a specific truststore, as described in this answer. You could even load this trust store from an InputStream from the classloader if you want to bundle it with your application.

    Alternatively, where possible, you could use the OS trust store directly. On Windows, you can load the Windows-ROOT keystore as described in this article. On OSX, you can load a KeychainStore.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple Java program that uses Jsch to connect to an SFTP
I am trying to make a program in Java that uses multithreading. This program
I'm have a java program that uses Apache httpclient api. This is used to
I want to make an java application. This is stored on gitHub (so uses
I'm having problems interacting with an HTTPS site via Java. My program uses one
How do I check how much resources a java program uses? In java it
I'm developing a Java plugin for an existing Java program. The existing program uses
I'm running a java program that uses many vectors. I'm afraid my use of
I have a Java 3D program which uses lots (hundreds) of 3D models (3ds
I have avery simple program which uses MediaPLayer. I am new to java and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.