I've developed a Java CFX tag to be used in ColdFusion 10. There is a Java class which gets an URL as param und should give back content of the website behind that URL.
We're using https protocol and I need to ignore certificate errors. Therefor I've implemented the solution being suggested here: HTTPS hostname wrong: should be . What causes this?
I've tested my methods in the way Adobe recommends it here: Approaches to debugging Java CFX tags
Everything works fine.
But when I attach my CFX tag to my ColdFusion Instance and try to use it from ColdFusion I'll become an error like this:
java.io.IOException: HTTPS hostname wrong
My question is, why? Debugging my CFX Tag shows no error, but using it in ColdFusion brings that error. For me it looks like ColdFusion overwrites some of my class declarations on runtime. Does anyone have some ideas? Is this phenomenon known? Has anybody else experienced that weird behaviour? Or am I getting something wrong?
To understand my problem here are some more facts:
- OS: Suse Linux Enterprise Server
- CF: ColdFusion 10 Multiserver
- Dev-Environment for Java: NetBeans 7.1.2
- Dev-Environment for CF: ColdFusion Builder 2.1
Some source code for demonstration purposes:
...
url = new URL("https://domainname/path/file.type");
HostnameVerifier hv = new HostnameVerifier() {
@Override
public boolean verify(String urlHostName, SSLSession ssls) {
System.out.println("Warning: URL HOST: " + urlHostName + " vs. " + ssls.getPeerHost());
return true;
}
};
HttpsURLConnection.setDefaultHostnameVerifier(hv);
URLConnection conn = url.openConnection();
...(Do something)...
Problem:
- Debbuging with main Method works fine
- Using CFX Tag in ColdFusion in the same way fails.