CAS客户端链接报错

博客内容讲述了在遇到CAS客户端连接时出现的SSLHandshakeException,即找不到有效的证书验证路径问题。解决方案包括复制代码并执行特定main函数,输入CAS服务器的IP地址和端口,然后根据提示将生成的证书导入到JAVA的keystore中,以此来解决证书不被信任的问题。
摘要由CSDN通过智能技术生成

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值