title: Handling an invalid security certificate using MATLAB's urlread command
body: <p>I'm accessing an internal database using MATLAB's <a href="http://www.mathworks.com/help/matlab/ref/urlread.html" rel="nofollow noreferrer"><code>urlread</code></a> command, everything was working fine until the service was moved to a secure server (i.e. with an HTTPS address rather than an HTTP address). Now <code>urlread</code> no longer successfully retrieves results. It gives an error:</p>
  
  <blockquote>
    <p>Error downloading URL. Your network connection may be down or your proxy settings improperly configured.</p>
  </blockquote>
  
  <p>I believe the problem is that the service is using an invalid digital certificate since if I try to access the resource directly in a web browser I get "untrusted connection" warning which I am able to pass through by adding the site to an Exception list. <code>urlread</code> doesn't have an obvious way of handling this problem.</p>
  
  <p>Under the hood <code>urlread</code> is using Java to access web resources, and the error is thrown at this line:</p>
  
  <pre><code>inputStream = urlConnection.getInputStream;
  </code></pre>
  
  <p>where <code>urlConnection</code> is a Java object: <code>sun.net.www.protocol.https.HttpsURLConnectionImpl</code>.</p>
  
  <p>Anyone suggest a workaround for this problem?    </p>