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 8867167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:57:56+00:00 2026-06-14T16:57:56+00:00

I want to connect to our university server using a SSL connection. I have

  • 0

I want to connect to our university server using a SSL connection.

I have in a configuration folder the following files:
– client.policy
– uni_keystore.jks
– uni_server.cer
– uni_truststore.jks

client.policy file contains the following:

grant { 
  permission java.security.AllPermission ;
};

The connection to the server is established, but when i try to read from server i get the exception:

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

This is how i connect to the server (i trimmed the try/catch blocks to shorten the code):

Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();

String configPath = "C:/eclipse/workspace/uniproject/";

Properties systemProps = System.getProperties();
systemProps.put( "javax.net.ssl.trustStore", configPath+"uni_truststore.jks");
systemProps.put( "javax.net.ssl.keyStore", configPath+"uni_keystore.jks");
System.setProperties(systemProps);

s = (SSLSocket) factory.createSocket(UNI_ADDRESS, UNI_PORT);

I’m connecting to the server over my VPN.

And this is how i try to read (i trimmed the try/catch blocks to shorten the code):

InputStream istream = s.getInputStream();
BufferedReader reader = new BufferedReader( new InputStreamReader(istream) );

String data;
do {
    // this lines throws exception
    data = reader.readLine();
    System.out.println(data);
}
while(data != null);

I’m not doing anything about client.policy and uni_server.cer files in the code. Could this be the problem? what am i missing?

Thanks.


2 more things:

– i installed the certification (before this post, i hadn’t had)
– i added the line:

systemProps.put( "javax.net.ssl.keyStorePassword", "pass");
  • 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-14T16:57:58+00:00Added an answer on June 14, 2026 at 4:57 pm

    Try re-sequencing your calls like this:

    String configPath = "C:/eclipse/workspace/uniproject/";
    Properties systemProps = System.getProperties();
    systemProps.put( "javax.net.ssl.trustStore", configPath+"uni_truststore.jks");
    systemProps.put( "javax.net.ssl.keyStore", configPath+"uni_keystore.jks");
    System.setProperties(systemProps);
    
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
    s = (SSLSocket) factory.createSocket(UNI_ADDRESS, UNI_PORT);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I connect to our Ubuntu production server using PuTTy. I want to reindex a
I want to connect from home using SQL Server 2005 to another PC. I
I have one server out of three which cannot connect to our sql server
In linux environment, I want to connect to our company's mail server and send
I want to connect my log4j.xml with log4j.xsd (xml schema). Project don't have any
I want to connect my rails 3 application to firebird database. I have followed
In my application I want to connect SQL Server Express with Hibernate. But I
I want to connect to multiple TFS server from Visual Studio 2010 team explorer.
I have Visual Studio 2008 running from Windows XP. Our server is Windows 2003
So our web server apps need to connect to the database, and some other

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.