Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Contributor
Posts: 11
Registered: ‎05-21-2012
My Device: multi-device (developer)
My Carrier: multi-provider (developer)

Navigating to a https page in a browserField causes a "No resource request handler for: tls://[…]"

[ Edited ]

Hi

I am using an embedded browserField in an application, and on my OS5 device when navigating to a https link I get request errors with the message "No resource request handler for: tls://[…]" where […] is the name of the resource.

 

I had a look on the handling of ssl resources in the documentation, but didn't find much on the link formats handled by the different device versions.

This is a simple code reproducing the problem (I build it on the OS5 SDK):

package mypackage;

import javax.microedition.io.InputConnection;

import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.browser.field2.BrowserFieldConfig;
import net.rim.device.api.browser.field2.BrowserFieldErrorHandler;
import net.rim.device.api.browser.field2.BrowserFieldRequest;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.container.MainScreen;

public class MyApp extends UiApplication {
	public static void main(String[] args) {

		MyApp theApp = new MyApp();
		theApp.enterEventDispatcher();
	}
	public MyApp() {
		this.pushScreen(new MyScreen());
	}
}

final class MyScreen extends MainScreen {
	public MyScreen() {
		BrowserFieldConfig config = new BrowserFieldConfig();
		BrowserField browserField = new BrowserField(config);

		config.setProperty(BrowserFieldConfig.ERROR_HANDLER, new BrowserFieldErrorHandler(browserField) {
			public InputConnection resourceRequestError(final BrowserFieldRequest request, final Throwable t) {
				UiApplication.getUiApplication().invokeLater(new Runnable() {
					public void run() {
						Dialog.alert("Resource request error: " + request.getURL() + " - " + t != null ? t.getClass().toString() + " " + t.getMessage() : "");
					}
				});
				return null;
			}
		});

		this.add(browserField);
		browserField.requestContent("http://www.accorhotels.mobi/");
	}
}

 

On the loading page, clicking on the "Trouvez un hotel" link, which is a https link will throw the error in a dialog box (a direct link to the https page wouldn't bring the detailed error).

 

The errors I get are in order:

  • No resource request handler for tls://secure.accordhotels.mobi:443/img/common/bg-header-xr.gif
  • No resource request handler for tls://secure.accordhotels.mobi:443/fr/img/booking/btn-find.gif
  • No resource request handler for tls://secure.accordhotels.mobi:443/images/img/booking/picto-more-criteria.png/333/400/PNG
  • No resource request handler for tls://secure.accordhotels.mobi:443/images/img/booking/ico-find-destination.gif/333/400/GIF
  • No resource request handler for tls://secure.accordhotels.mobi:443/images/img/booking/logo-ah.gif/333/400/GIF
  • No resource request handler for tls://secure.accordhotels.mobi:443/images/img/commonbtn-header-menu-off.gif/333/400/GIF
  • No resource request handler for tls://secure.accordhotels.mobi:443/widgets/bk.css

These match all the resource files requested by the page by relative urls ( the last css file for instance is requested in a '/widgets/bk.css' url css link.


 

I am testing on an Storm 9520 on OS5 (V5.0.0.36), a client has the same error on a 9790 on OS7 (7.0.0.557). In comparison it was fine on newer devices like the Bold 9900 on OS7.1 or Curve 9380 on OS7.1.

 


As a workaround I tried overriding the protocol handler to rewrite all tls:// request into https:// ones. It partly fixes the problem (all images and css are fetched) but brings other issues (form submission doesn't work, no form values seem to be transmitted when the request object is manipulated, even GET method forms)

Did anyone run into similar issues, or have any insight on this problem ?

Thanks in advance