CAS客户端链接报错,如:
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
原因是证书不对,安装证书步骤:
1. Copy下面的代码,执行下面main函数
2. main函数有一个参数,cas IP地址和端口 如:127.0.0.1:443
3. 执行中间输入 :1
4:当你输入"1"后,InstallCert.java 会显示证书的有关信息,然后把证书导入到一个名为"jssecacerts"的keystore中(当前目录),只需要把这个文件拷贝到 JAVA_HOME/jre/lib/security目录中,重命名为"cacerts".
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Sun Microsystems nor the names of its
* contributors may be used to endorse or promote products deriv