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
Developer
tonybse
Posts: 61
Registered: ‎09-29-2008
My Device: Not Specified

Request Entity Too Large with https

Hi,

 

I use web basic authorisation to obtain a http connection. here is the short segment of the code :

 

con = (HttpConnection) Connector.open( url );

con.setRequestMethod(HttpConnection.GET);

con.setRequestProperty("content-type","application/x-www-form-urlencoded");

con.setRequestProperty("connection","Keep-Alive");

con.setRequestProperty("cache-control","no-cache")

con.setRequestProperty("accept","*/*");

con.setRequestProperty("content-length","");

con.setRequestProperty("user-agent","Mozilla/4.0 (compatible) Java JME/0.0.0.0");       con.setRequestProperty("Authorization", "Basic " + ENCODEDUSERPASS


respCode = con.getResponseCode();  
respMessage = con.getResponseMessage();

 

Everything works fine with http. 

However, when I tried to use the same code with https:// url  and changed HttpConnection to HttpsConnection in the code, I am getting     
  

413 : Request Entity Too Large

 

I do not have a problem to connect to http url without basic authorisation;  http  with basci authorisation; and https without basic authorisation.

 

The problem is coming only  when I attempt to use https url with basic authorisation.

 

I assume I am missing a detail here.. any ideas, anybody? Thanks...

Please use plain text.
Developer
tonybse
Posts: 61
Registered: ‎09-29-2008
My Device: Not Specified

Re: Request Entity Too Large with https

I forgot to mention - I am using JDE 4.1 with emulator

 

the same url (https) with basic authorisation can be open without a problem from a PC browser.

 

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Request Entity Too Large with https

[ after wiating for stupid html editor to finish doing whatever it does... ]

 

Anyway, assuming my TEXT gets around this html junk, it may help to try this with wget or curl or a similar

utility and fake the profile and user agent. I wasn't sure if wget works on https but on cygwin it did seem

to function. If you get the headers at least you could post them here for a more specific comment.

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,444
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Request Entity Too Large with https

How big are the files you are trying to download?  Please have a look at the following links.

 

What Is - HTTP 413 Request Entity Too Large
Article Number: DB-00623

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

 

How To - Download large files using the BlackBerry Mobile Data System
Article Number: DB-00619

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800431/How_To_...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Request Entity Too Large with https

Is there any reason to suggest that the BB servers care about http vs https? The OP's server of interest

may be reacting differently and in any case a dump from a command line utility would tell us that.

 

If the servers support "byte-range" requests that is another approach both to get around

the connection limitations and for implementing various kinds of fake streaming.

 

Please use plain text.
Developer
tonybse
Posts: 61
Registered: ‎09-29-2008
My Device: Not Specified

Re: Request Entity Too Large with https

Iam not trying to donwload anything, just to make a connection to the main entry of the directory https://www.xxxx.xom

There is one file inside onlym about 50k

 

As I mentioned before, the problem came only when the url is https and I include a basic authorization

 

 

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Request Entity Too Large with https

What have you got against finding out what the server is doing? That is, you can go get cygwin ( cygwin.com )

and use curl or maybe wget to hit the server and check the response. I routinely use this to check jad files,

isn't any different here. You can verify that with your assumed headers the server is returning something

sane. Alternatively, you can redirect you BB request to a dummy server and check the request as recieved.

In either case, getting real information would help(" I tried this and got an error. What is wrong?").

 

I'd be happy to hit your server if you can tell me what you are trying to do and don't have to reveal any

passwords. If I had access to a machine with a static IP that I could install cygwin on, I'd be happy to

setup a test server too but your server logs may tell you what you need.

 

 

Please use plain text.
Developer
tonybse
Posts: 61
Registered: ‎09-29-2008
My Device: Not Specified

Re: Request Entity Too Large with https

 marchywka, thanks for the help. It is not my server, I am not allowed to provide you the link, but will try cygwin and hopefully will post the results
Please use plain text.
Developer
davidmccormack
Posts: 168
Registered: ‎11-01-2008
My Device: Galaxy S II
My Carrier: Meteor (Ireland)

Re: Request Entity Too Large with https

@marchywka - you don't have the problem with https URLs because when end-to-end SSL is being used the BIS-B can't see what size the entity is because the Content-Length header gets encrypted along with everything else running through the SSL socket. That's been my experience using the MDS-CS simulator anyway. If I use http URLs I hit the 512 KB limit and get error 413 - switch it to https and the problem goes away.
Please use plain text.