[Webtest] webtest cannot handle the lack of a secure certificate in our test environment

John and Pip John and Pip" <pipandjohn@gmail.com
Mon, 11 Dec 2006 15:06:07 +1300


------=_Part_53737_21323953.1165802767179
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi All,

I am testing a secure website, and have not problem in the production
system, hitting and logging into
https://registration.airnewzealand.com/spr/login/login.jsp

However, in our test environment, if you access this page in IE you see a
popup saying "Unable to verify the identity of
registration.airnewzealand.com as a trusted site." etc etc.

When I try to log in on this page in the test environment (by using a proxy)
using the following code:

<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "WebTest.dtd">
<project name="OLH" basedir="." default="main">
    <property name="webtest.home" location="..\.."/>
    <import file="${webtest.home}/lib/taskdef.xml"/>
    <target name="main">
        <setproxy proxyhost="10.16.32.33" proxyport="4005" />   <!-- set to
FT3 direct proxy -->
        <webtest name="ISIS SFF NZ Search">
<config
                host="any"
                port="1234"
                protocol="http"
                basepath=""
                summary="true"
                saveresponse="true"
                resultpath="..\webtest-results"
                resultfile="results.xml"
                showhtmlparseroutput="false"
                autorefresh="true"
                haltonfailure="false"
                timeout="120">
                <option name="RedirectEnabled" value="true" />
                <header name="User-Agent" value="WebTest" />
</config>
            <steps>
                   <groovy>
                       def logFile = new File('./webtest.log')
                    logFile.append("\nTest Start\n")
                    logFile.append(step.context.webClient.toString())
                      logFile.append("\nTest End\n")
                   </groovy>
                <invoke url="
https://registration.airnewzealand.com/spr/login/login.jsp"/>
                <!-- This fails with a "connection timed out error. It also
fails in this format:
https://registration.airnewzealand.com/spr?login?login.jsp -->
                <verifyTitle text="Air New Zealand - My Account"/>
                <verifyText text="Login"/>
                <setInputField name="username" value="966594"/>
                <setInputField name="password"
value="password01"/>                <!-- Qual value -->
                <clickButton description="Click image button: "
name="image"/>
                <verifyTitle text="Air New Zealand - My Airpoints Account"/>
                <verifyText text="My Airpoints Account"/>
             </steps>
        </webtest>
    </target>
</project>

I get:

C:\WebTest\doc\ISIS>webtest -debug -f testFT3.xml  > out.txt

BUILD FAILED
C:\WebTest\doc\ISIS\testFT3.xml:8: Canoo Webtest: R_1438.
Test failed.
Exception raised: com.canoo.webtest.engine.StepExecutionException:
Unexpected ex
ception caught: javax.net.ssl.SSLHandshakeException:
sun.security.validator.Vali
datorException: PKIX path building failed:
sun.security.provider.certpath.SunCer
tPathBuilderException: unable to find valid certification path to requested
targ
et, Step: InvokePage at C:\WebTest\doc\ISIS\testFT3.xml:32:  with
(taskName="inv
oke")com.canoo.webtest.engine.StepExecutionException: Unexpected exception
caugh
t: javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorExceptio
n: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderE
xception: unable to find valid certification path to requested target, Step:
Inv
okePage at C:\WebTest\doc\ISIS\testFT3.xml:32:  with (taskName="invoke")
        at com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java
:413)

[rest of the stack below if you are interested]

and the relevant bit of the webtest debug output is:

Build sequence for target(s) `main' is [main]
Complete build sequence is [main, ]

main:
 [setproxy] Setting proxy to 10.16.32.33:4005
Setting project property: webtest.version -> Canoo Webtest: R_1438.
Adding reference: ant.PropertyHelper
Adding reference: ant.PropertyHelper
[Fatal Error] :-1:-1: Premature end of file.

A developer here has passed on this code to work around a similar problem in
httpunit:

  private static void trustAll()
  {
    TrustManager[] trustAllCerts = new TrustManager[] { new
X509TrustManager()
    {

      public java.security.cert.X509Certificate[] getAcceptedIssuers()
      {
        return null;
      }

      public void checkClientTrusted(java.security.cert.X509Certificate[]
certs, String authType)
      {
      }

      public void checkServerTrusted(java.security.cert.X509Certificate[]
certs, String authType)
      {
      }
    } };

    HostnameVerifier hostnameVerifier = new HostnameVerifier()
    {
      public boolean verify(String rserver, SSLSession sses)
      {

        if (!rserver.equals(sses.getPeerHost()))
        {
          if (!warnedCertificates.contains(sses.getPeerHost()))
          {
            warnedCertificates.add(sses.getPeerHost());
            log.warn("certificate <" + sses.getPeerHost() + "> does not
match host <" + rserver + ">");
          }
        }

        return true;
      }
    };

Unfortunately I do not have access to him to work on htmlunit if in fact
there is a similar issue there, and I am not a java developer so don't fancy
my chances messing with the htmlunit internals.

Can anyone confirm whether this is a defect (limitation?) in htmlunit, and
whether I should open an issue, and hopefully a solution so I can continue
writing my webtests? Thanks.

regards,
        John



        at
com.canoo.webtest.steps.AbstractBrowserAction.handleUnexpectedExcepti
on(AbstractBrowserAction.java:120)
        at com.canoo.webtest.steps.request.TargetHelper.protectedGoto
(TargetHelp
er.java:115)
        at com.canoo.webtest.steps.request.AbstractTargetAction.gotoTarget
(Abstr
actTargetAction.java:106)
        at com.canoo.webtest.steps.request.AbstractTargetAction.doExecute
(Abstra
ctTargetAction.java:78)
        at com.canoo.webtest.steps.Step.execute(Step.java:106)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java
:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at com.canoo.webtest.ant.TestStepSequence.executeSteps
(TestStepSequence.
java:43)
        at com.canoo.webtest.ant.TestStepSequence.doExecute(
TestStepSequence.jav
a:31)
        at com.canoo.webtest.steps.Step.execute(Step.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:164)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java
:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java
:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExe
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: javax.net.ssl.SSLHandshakeException:
sun.security.validator.Validator
Exception: PKIX path building failed:
sun.security.provider.certpath.SunCertPath
BuilderException: unable to find valid certification path to requested
target
        at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java
:150)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(
SSLSocketImpl.java:1
476)
        at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java
:174)
        at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java
:168)
        at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate
(Clien
tHandshaker.java:847)
        at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage
(ClientHa
ndshaker.java:106)
        at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(
Handshaker.java:4
95)
        at com.sun.net.ssl.internal.ssl.Handshaker.process_record(
Handshaker.jav
a:433)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(
SSLSocketImpl.j
ava:815)
        at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SS
LSocketImpl.java:1025)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord
(SSLSocketImpl.
java:619)
        at com.sun.net.ssl.internal.ssl.AppOutputStream.write(
AppOutputStream.ja
va:59)
        at java.io.BufferedOutputStream.flushBuffer(
BufferedOutputStream.java:65
)
        at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
        at
org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream
(HttpConnection.java:827)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$Http
ConnectionAdapter.flushRequestOutputStream(
MultiThreadedHttpConnectionManager.ja
va:1525)
        at org.apache.commons.httpclient.HttpMethodBase.writeRequest
(HttpMethodB
ase.java:1975)
        at org.apache.commons.httpclient.HttpMethodBase.execute(
HttpMethodBase.j
ava:993)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
(Htt
pMethodDirector.java:397)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod
(HttpMe
thodDirector.java:170)
        at org.apache.commons.httpclient.HttpClient.executeMethod(
HttpClient.jav
a:396)
        at org.apache.commons.httpclient.HttpClient.executeMethod(
HttpClient.jav
a:346)
        at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse
(HttpWebCo
nnection.java:126)
        at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnect
ion(WebClient.java:1371)
        at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(
WebClient.jav
a:1329)
        at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java
:322)
        at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java
:389)
        at com.canoo.webtest.steps.request.TargetHelper.getResponse
(TargetHelper
.java:69)
        at com.canoo.webtest.steps.request.AbstractTargetAction.getResponse
(Abst
ractTargetAction.java:68)
        at com.canoo.webtest.steps.request.InvokePage.findTarget(
InvokePage.java
:134)
        at com.canoo.webtest.steps.request.AbstractTargetAction$1.call
(AbstractT
argetAction.java:108)
        at com.canoo.webtest.steps.request.TargetHelper.protectedGoto
(TargetHelp
er.java:88)
        ... 22 more
Caused by: sun.security.validator.ValidatorException: PKIX path building
failed:
 sun.security.provider.certpath.SunCertPathBuilderException: unable to find
vali
d certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java
:221)
        at sun.security.validator.PKIXValidator.engineValidate(
PKIXValidator.jav
a:145)
        at sun.security.validator.Validator.validate(Validator.java:203)
        at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
X509TrustManagerImpl.java:172)
        at
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(
SSLContextImpl.java:320)
        at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate
(Clien
tHandshaker.java:840)
        ... 49 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
unable to
 find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild
(SunCert
PathBuilder.java:236)
        at java.security.cert.CertPathBuilder.build(CertPathBuilder.java
:194)
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java
:216)
        ... 54 more

        at com.canoo.webtest.ant.WebtestTask.stopBuildIfNeeded(
WebtestTask.java:
228)
        at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:175)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java
:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java
:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExe
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 4 seconds

C:\WebTest\doc\ISIS>


Incidentally, the above has the test environment password which is different
to the production one so you can't run it against the public page.

------=_Part_53737_21323953.1165802767179
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi All,<br><br>I am testing a secure website, and have not problem in the production system, hitting and logging into <a href="https://registration.airnewzealand.com/spr/login/login.jsp">https://registration.airnewzealand.com/spr/login/login.jsp
</a><br><br>However, in our test environment, if you access this page in IE you see a popup saying &quot;Unable to verify the identity of <a href="http://registration.airnewzealand.com">registration.airnewzealand.com</a> as a trusted site.&quot; etc etc.
<br><br>When I try to log in on this page in the test environment (by using a proxy) using the following code:<br><br><div style="margin-left: 40px;">&lt;?xml version=&quot;1.0&quot;?&gt;<br>&lt;!DOCTYPE project SYSTEM &quot;
WebTest.dtd&quot;&gt;<br>&lt;project name=&quot;OLH&quot; basedir=&quot;.&quot; default=&quot;main&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;webtest.home&quot; location=&quot;..\..&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;import file=&quot;${
webtest.home}/lib/taskdef.xml&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;target name=&quot;main&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;setproxy proxyhost=&quot;<a href="http://10.16.32.33">10.16.32.33</a>&quot; proxyport=&quot;4005&quot; /&gt;&nbsp;&nbsp; &lt;!-- set to FT3 direct proxy --&gt;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;webtest name=&quot;ISIS SFF NZ Search&quot;&gt;<br>&lt;config <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; host=&quot;any&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; port=&quot;1234&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protocol=&quot;http&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; basepath=&quot;&quot;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; summary=&quot;true&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; saveresponse=&quot;true&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resultpath=&quot;..\webtest-results&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resultfile=&quot;results.xml&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; showhtmlparseroutput=&quot;false&quot;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; autorefresh=&quot;true&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; haltonfailure=&quot;false&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; timeout=&quot;120&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;option name=&quot;RedirectEnabled&quot; value=&quot;true&quot; /&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;header name=&quot;User-Agent&quot; value=&quot;WebTest&quot; /&gt;<br>&lt;/config&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;steps&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;groovy&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; def logFile = new File('./webtest.log')
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; logFile.append(&quot;\nTest Start\n&quot;)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; logFile.append(step.context.webClient.toString())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; logFile.append(&quot;\nTest End\n&quot;)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/groovy&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;invoke url=&quot;<a href="https://registration.airnewzealand.com/spr/login/login.jsp">https://registration.airnewzealand.com/spr/login/login.jsp</a>&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;!-- This fails with a &quot;connection timed out error. It also fails in this format: 
<a href="https://registration.airnewzealand.com/spr?login?login.jsp">https://registration.airnewzealand.com/spr?login?login.jsp</a> --&gt;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;verifyTitle text=&quot;Air New Zealand - My Account&quot;/&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;verifyText text=&quot;Login&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;setInputField name=&quot;username&quot; value=&quot;966594&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;setInputField name=&quot;password&quot; value=&quot;password01&quot;/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- Qual value --&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;clickButton description=&quot;Click image button: &quot; name=&quot;image&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;verifyTitle text=&quot;Air New Zealand - My Airpoints Account&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;verifyText text=&quot;My Airpoints Account&quot;/&gt;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/steps&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/webtest&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/target&gt;<br>&lt;/project&gt;<br></div><br>I get:<br><div style="margin-left: 80px;"><br></div><div style="margin-left: 40px;">C:\WebTest\doc\ISIS&gt;webtest -debug -f 
testFT3.xml&nbsp; &gt; out.txt<br><br>BUILD FAILED<br>C:\WebTest\doc\ISIS\testFT3.xml:8: Canoo Webtest: R_1438.<br>Test failed.<br>Exception raised: com.canoo.webtest.engine.StepExecutionException: Unexpected ex<br>ception caught: 
javax.net.ssl.SSLHandshakeException: sun.security.validator.Vali<br>datorException: PKIX path building failed: sun.security.provider.certpath.SunCer<br>tPathBuilderException: unable to find valid certification path to requested targ
<br>et, Step: InvokePage at C:\WebTest\doc\ISIS\testFT3.xml:32:&nbsp; with (taskName=&quot;inv<br>oke&quot;)com.canoo.webtest.engine.StepExecutionException: Unexpected exception caugh<br>t: javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorExceptio<br>n: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE<br>xception: unable to find valid certification path to requested target, Step: Inv<br>okePage at C:\WebTest\doc\ISIS\testFT3.xml:32:&nbsp; with (taskName=&quot;invoke&quot;)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:413)<br></div><br>[rest of the stack below if you are interested]<br><br>and the relevant bit of the webtest debug output is:<br><br><div style="margin-left: 40px;">
Build sequence for target(s) `main' is [main]<br>Complete build sequence is [main, ]<br><br>main:<br>&nbsp;[setproxy] Setting proxy to <a href="http://10.16.32.33:4005">10.16.32.33:4005</a><br>Setting project property: webtest.version
 -&gt; Canoo Webtest: R_1438.<br>Adding reference: ant.PropertyHelper<br>Adding reference: ant.PropertyHelper<br>[Fatal Error] :-1:-1: Premature end of file.<br></div><br>A developer here has passed on this code to work around a similar problem in httpunit:
<br><br><div style="margin-left: 40px;">&nbsp; private static void trustAll()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager()<br>&nbsp;&nbsp;&nbsp; {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public java.security.cert.X509Certificate
[] getAcceptedIssuers()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return null;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; } };<br><br>&nbsp;&nbsp;&nbsp; HostnameVerifier hostnameVerifier = new HostnameVerifier()<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public boolean verify(String rserver, SSLSession sses)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!rserver.equals(sses.getPeerHost()))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!warnedCertificates.contains(sses.getPeerHost()))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; warnedCertificates.add(sses.getPeerHost());
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log.warn(&quot;certificate &lt;&quot; + sses.getPeerHost() + &quot;&gt; does not match host &lt;&quot; + rserver + &quot;&gt;&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }; 
<br></div><br>Unfortunately I do not have access to him to work on htmlunit if in fact there is a similar issue there, and I am not a java developer so don't fancy my chances messing with the htmlunit internals.<br><br>Can anyone confirm whether this is a defect (limitation?) in htmlunit, and whether I should open an issue, and hopefully a solution so I can continue writing my webtests? Thanks.
<br><br>regards,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; John<br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.AbstractBrowserAction.handleUnexpectedExcepti<br>on(AbstractBrowserAction.java:120)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.request.TargetHelper.protectedGoto
(TargetHelp<br>er.java:115)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.request.AbstractTargetAction.gotoTarget(Abstr<br>actTargetAction.java:106)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.request.AbstractTargetAction.doExecute(Abstra
<br>ctTargetAction.java:78)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.Step.execute(Step.java:106)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Task.perform
(Task.java:364)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.<br>java:43)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.jav<br>a:31)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.Step.execute
(Step.java:106)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Task.perform(Task.java:364)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:164)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java
:275)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Task.perform(Task.java:364)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Target.execute(Target.java:341)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Target.performTasks(Target.java:369)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Project.executeTarget(Project.java:1185)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
<br>cutor.java:40)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Project.executeTargets(Project.java:1068)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Main.runBuild(Main.java:668)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Main.startAnt(Main.java:187)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)<br>Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.Validator
<br>Exception: PKIX path building failed: sun.security.provider.certpath.SunCertPath<br>BuilderException: unable to find valid certification path to requested target<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.Alerts.getSSLException
(Alerts.java:150)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1<br>476)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE
(Handshaker.java:168)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Clien<br>tHandshaker.java:847)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHa<br>ndshaker.java
:106)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:4<br>95)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.jav<br>a:433)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord
(SSLSocketImpl.j<br>ava:815)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SS<br>LSocketImpl.java:1025)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.
<br>java:619)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.ja<br>va:59)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65<br>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.io.BufferedOutputStream.flush
(BufferedOutputStream.java:123)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream<br>(HttpConnection.java:827)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$Http
<br>ConnectionAdapter.flushRequestOutputStream(MultiThreadedHttpConnectionManager.ja<br>va:1525)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodB<br>ase.java:1975)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.commons.httpclient.HttpMethodBase.execute
(HttpMethodBase.j<br>ava:993)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Htt<br>pMethodDirector.java:397)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMe
<br>thodDirector.java:170)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav<br>a:396)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav<br>a:346)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebCo<br>nnection.java:126)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnect<br>ion(WebClient.java:1371)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse
(WebClient.jav<br>a:1329)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:322)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:389)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.request.TargetHelper.getResponse
(TargetHelper<br>.java:69)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.request.AbstractTargetAction.getResponse(Abst<br>ractTargetAction.java:68)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.request.InvokePage.findTarget(InvokePage.java
<br>:134)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.request.AbstractTargetAction$1.call(AbstractT<br>argetAction.java:108)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.steps.request.TargetHelper.protectedGoto(TargetHelp<br>er.java:88)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... 22 more<br>Caused by: sun.security.validator.ValidatorException: PKIX path building failed:<br>&nbsp;sun.security.provider.certpath.SunCertPathBuilderException: unable to find vali<br>d certification path to requested target
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.jav<br>a:145)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.security.validator.Validator.validate
(Validator.java:203)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(<br>X509TrustManagerImpl.java:172)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted
(<br>SSLContextImpl.java:320)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Clien<br>tHandshaker.java:840)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... 49 more<br>Caused by: sun.security.provider.certpath.SunCertPathBuilderException
: unable to<br>&nbsp;find valid certification path to requested target<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCert<br>PathBuilder.java:236)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.security.cert.CertPathBuilder.build
(CertPathBuilder.java:194)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... 54 more<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.ant.WebtestTask.stopBuildIfNeeded(WebtestTask.java:<br>
228)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:175)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Task.perform(Task.java
:364)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Target.execute(Target.java:341)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Target.performTasks(Target.java:369)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Project.executeSortedTargets(Project.java
:1216)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Project.executeTarget(Project.java:1185)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe<br>cutor.java:40)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Project.executeTargets
(Project.java:1068)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Main.runBuild(Main.java:668)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.Main.startAnt(Main.java:187)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)<br><br>Total time: 4 seconds<br><br>C:\WebTest\doc\ISIS&gt;<br><br><br>Incidentally, the above has the test environment password which is different to the production one so you can't run it against the public page.
<br>

------=_Part_53737_21323953.1165802767179--