[TIMOB-12401] iOS: ImageView on SDK 3.0 not showing images from a specific server, while images on mobile's web browser are shown fine.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-02-27T19:02:59.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 05 API, 2013 Sprint 05 |
Components | iOS |
Labels | api, module_imageview, qe-port, regression, triage |
Reporter | Michael Massalas |
Assignee | Vishal Duggal |
Created | 2012-12-20T16:21:32.000+0000 |
Updated | 2013-10-17T09:38:34.000+0000 |
Description
*Problem description*
As I stated above, ImageView on SDK 3.0 is not showing images from a specific server, although the same images on the same mobile's web browser are shown fine.
Me and some other people from the community tried everything, changing the photo, changing the server, putting another photo in this server etc. and we came to a conclusion that it happens only when SDK 3.0 "meets" this server. (SDK 2.1.4 works fine with this server)
An image example is this: http://www.lillikas.com/images/barosso2.jpg
For example, if you download this image and upload it to another server it works fine.
*Workaround*
The following value within the cache header causes the issue:
Cache-Control: no-cache
I am not sure what's wrong with the 'no-cache' (perhaps the dash?!) but that's it. To get rid of it you need to configure your IIS not to send this value.
*Sample code*
var win = Ti.UI.createWindow({
backgroundColor : "#FFF"
});
var icon = Titanium.UI.createImageView({
image : "http://www.lillikas.com/images/barosso2.jpg",
left : 11,
top : 12,
height : 60,
width : 111
});
win.add(icon);
win.open();
Someone else had this problem also on another server, quoting from appcelerator Q&A: "I have the same problem Michael ! My remote images works fine in 2.1.4 but not since 3.0. It's very strange and iOS only, works on Android... — commented Yesterday by Girod Frédéric"
I know where the problem is but I can only tell you what causes it so you can fix it in your next SDK update. Here is the issue cause (quoting another person with the same issue): "After excessive testing, debugging but also sniffing the traffic, I have ended up that the problem is the specific caching value of the cache-control header. To be more precise the following header is causing the issue. Cache-Control: no-cache Caching is not an issue, but the value 'no-cache' is causing the problem. (perhaps it's the dash?!) It's a bug that needs to be resolved. George"
Maybe it will help. Our app show the images from a php link. (in 2.1.4 it works all the time) Now it only works when we got this header with the file: Connection: Keep-Alive Content-Length: 1655 Date: Mon, 11 Feb 2013 14:32:33 GMT Keep-Alive: timeout=15, max=97 Server: Apache/2.2.22 (Debian) X-Powered-By: PHP/5.4.4-10 If we get this header, it isn't work: Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection: Keep-Alive Content-Length: 1539 Date: Mon, 11 Feb 2013 14:32:28 GMT Expires: Thu, 19 Nov 1981 08:52:00 GMT Keep-Alive: timeout=15, max=99 Pragma: no-cache Server: Apache/2.2.22 (Debian) X-Powered-By: PHP/5.4.4-10 The difference is: 'Cache-Control', 'Expires', 'Pragma'
Regression caused due to fix for TIMOB-3749
Pull pending https://github.com/appcelerator/titanium_mobile/pull/3888
Verified fix with: Titanium Studio, build: 3.0.2.201302191606 Titanium SDK, build: 3.1.0.v20130306004750 Device: iPhone5 iOS 6.1.2 iPad mini iOS 6.0
I have an issue related to this where Android images views cannot display SECURE remote images. This is urgent. Trying an imageView with image:'http://www.google.co.uk/images/srpr/logo4w.png' works fine .. but (note https) image:'https://www.google.co.uk/images/srpr/logo4w.png' throws : {{E/TiDownloadManager( 783): (pool-3-thread-1) [166,166] Exception downloading https://www.google.co.uk/images/srpr/logo4w.png E/TiDownloadManager( 783): javax.net.ssl.SSLHandshakeException: org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: current time: Wed Apr 09 02:50:03 GMT 1980, validation time: Mon Jun 08 21:43:27 GMT 2009 E/TiDownloadManager( 783): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:477) E/TiDownloadManager( 783): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:328) E/TiDownloadManager( 783): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.setupSecureSocket(HttpConnection.java:185) E/TiDownloadManager( 783): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:433) E/TiDownloadManager( 783): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeConnection(HttpsURLConnectionImpl.java:378) E/TiDownloadManager( 783): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018) E/TiDownloadManager( 783): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:512) E/TiDownloadManager( 783): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:258) E/TiDownloadManager( 783): at java.net.URL.openStream(URL.java:645) E/TiDownloadManager( 783): at org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:135) E/TiDownloadManager( 783): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) E/TiDownloadManager( 783): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) E/TiDownloadManager( 783): at java.lang.Thread.run(Thread.java:1019) E/TiDownloadManager( 783): Caused by: java.security.cert.CertificateException: org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: current time: Wed Apr 09 02:50:03 GMT 1980, validation time: Mon Jun 08 21:43:27 GMT 2009 E/TiDownloadManager( 783): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:161) E/TiDownloadManager( 783): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:664) E/TiDownloadManager( 783): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method) E/TiDownloadManager( 783): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:474) E/TiDownloadManager( 783): ... 12 more E/TiDownloadManager( 783): Caused by: org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: current time: Wed Apr 09 02:50:03 GMT 1980, validation time: Mon Jun 08 21:43:27 GMT 2009 E/TiDownloadManager( 783): at org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(RFC3280CertPathUtilities.java:1521) E/TiDownloadManager( 783): at org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:329) E/TiDownloadManager( 783): at java.security.cert.CertPathValidator.validate(CertPathValidator.java:197) E/TiDownloadManager( 783): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:156) E/TiDownloadManager( 783): ... 15 more E/TiDownloadManager( 783): Caused by: java.security.cert.CertificateNotYetValidException: current time: Wed Apr 09 02:50:03 GMT 1980, validation time: Mon Jun 08 21:43:27 GMT 2009 E/TiDownloadManager( 783): at org.apache.harmony.security.provider.cert.X509CertImpl.checkValidity(X509CertImpl.java:178) E/TiDownloadManager( 783): at org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(RFC3280CertPathUtilities.java:1512) E/TiDownloadManager( 783): ... 18 more}}
.. sorry: I should add, I'm using : Titanium SDK version 3.1.0.v20130314163255
sorry again... This appears to be fine on Android 4.0.4 (SII), but not on Android 2.2.3 (Nexus One) (those are the only version I can currently test on).
I can confirm the problem Kosso reports. On a Samsung S4 Mini (Android 4.2.2) it is not possible to show images with ImageView when the image is located on a https URL. For us, this is pretty urgent.