title: CFX throws error: "java.io.IOException: HTTPS hostname wrong"
body: <p>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.</p>
  
  <p>We're using https protocol and I need to ignore certificate errors. Therefor I've implemented the solution being suggested here: <a href="https://stackoverflow.com/a/3293720/522293">HTTPS hostname wrong: should be . What causes this?</a></p>
  
  <p>I've tested my methods in the way Adobe recommends it here: <a href="http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a4b8-7fed.html" rel="nofollow noreferrer">Approaches to debugging Java CFX tags</a></p>
  
  <p>Everything works fine.</p>
  
  <p>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: </p>
  
  <blockquote>
    <p>java.io.IOException: HTTPS hostname wrong </p>
  </blockquote>
  
  <p>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?</p>
  
  <p>To understand my problem here are some more facts:</p>
  
  <ul>
  <li>OS: Suse Linux Enterprise Server </li>
  <li>CF: ColdFusion 10 Multiserver</li>
  <li>Dev-Environment for Java: NetBeans 7.1.2 </li>
  <li>Dev-Environment for CF: ColdFusion Builder 2.1</li>
  </ul>
  
  <p>Some source code for demonstration purposes:</p>
  
  <pre><code>...
  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)...
  </code></pre>
  
  <p>Problem:</p>
  
  <ul>
  <li>Debbuging with main Method works fine</li>
  <li>Using CFX Tag in ColdFusion in the same way fails.</li>
  </ul>