Cannot verify "PDF" spawned web pages


#21

hi,

check my comment here
https://forum.katalon.com/t/katalon-pdf-comparison/19074/4

#22

Thanks Dave for your work on this. It will make validating the many pdf’s we maintain a cinch. One issue I am having is in my Dev environment, we don’t maintain valid certs so I end up with the following error. I have imported the cert into cacert in Katalon. The code does load the pdf but fails when trying to use the ReadPDF code.

Any help on bypassing the SSL issue would be greatly appreciated.

Test Cases/Check PDF FAILED.
Reason:org.codehaus.groovy.runtime.InvokerInvocationException:
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
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:49)


#23

Hi Dennis,

I am not sure how you would solve your SSL issue.

Any Katalon folks have an idea?


#24

Appreciate you responding Dave. I was able to find a work around for my SSL issue. I have added the below to the Check PDF Test Case and the issue is no longer showing.

//######################################
//Remove/Comment out the section below when testing in production!!!

def nullTrustManager = [
checkClientTrusted: { chain, authType -> },
checkServerTrusted: { chain, authType -> },
getAcceptedIssuers: { null }
]

def nullHostnameVerifier = [
verify: { hostname, session ->
//true
hostname.startsWith(‘yuml.me’)
}
]

javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance(“SSL”)
sc.init(null, [nullTrustManager as javax.net.ssl.X509TrustManager] as javax.net.ssl.X509TrustManager[], null)
javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory())
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(nullHostnameVerifier as javax.net.ssl.HostnameVerifier)
//Remove/Comment out the section above when testing in production!!!
//######################################

Taken from - https://gist.github.com/barata0/63705c0bcdd1054af2405e90c06f6b71


#25

Hi Dennis,

This is great news!

And thanks for posting your solution; this may help the next person to solve a similar issue.

Best regards,
Dave


#26

This Worked for me also. Thanks !