我想我想了解SSL的工作原理,我有基于Grails的应用程序作为应用程序的一部分,我们必须打开“https”连接到第三方应用程序。 但运行到以下异常SSL错误,同时打开输入流
"sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
虽然连接到URL工作正常,但是当我尝试打开输入流读取数据发生错误。问题是如果有证书问题,在打开连接时不应该有问题吗? 代码片段连接
try{
URL url= new URL("https://.../..")
def c = url.openConnection()
println("connection successful with Merchant")
def result = c.inputStream.text?.trim() // results in error
println(result)
}
catch (Exception exp){
println("error !!!")
println(exp.getMessage())
}
def ..不是java标记的 – stacker