Unable to find valid certification path to requested target - error even after cert imported

前端 未结 10 2036
野的像风
野的像风 2020-11-22 13:12

I have a Java client trying to access a server with a self-signed certificate.

When I try to Post to the server, I get the following error:

un

10条回答
  •  感情败类
    2020-11-22 13:32

    You need to configuring JSSE System Properties, specifically point to client certificate store.

    Via command line:

    java -Djavax.net.ssl.trustStore=truststores/client.ts com.progress.Client
    

    or via Java code:

    import java.util.Properties;
        ...
        Properties systemProps = System.getProperties();
        systemProps.put("javax.net.ssl.keyStorePassword","passwordForKeystore");
        systemProps.put("javax.net.ssl.keyStore","pathToKeystore.ks");
        systemProps.put("javax.net.ssl.trustStore", "pathToTruststore.ts");
        systemProps.put("javax.net.ssl.trustStorePassword","passwordForTrustStore");
        System.setProperties(systemProps);
        ...
    

    For more refer to details on RedHat site.

提交回复
热议问题