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

BlackBerry Web Services

Reply
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Proxy settings in the work perimeter

We have a connection issue with our software on a customer site.

 

The software tries to reach a server, and this silently fails - no error message, no timeout, no slots triggered. We waited for 30min and no change, so it seems there is no timeout set (but that would be another question).

 

We activated a test device on their BES and tried to reach the server from the work browser, which succeeded.

There is a proxy configuration active, when we enter a non-existant url we get an error site from the proxy.

 

Our logs show that a connection is established, we get a challange for a self-signed certificate which we handle by calling qNetworkReply->ignoreSslErrors with a list of expected errors.

 

Now it would be possible to either call QNetworkProxy::setApplicationProxy with a user-defined proxy or call QNetworkProxyFactory::setUseSystemConfiguration(true), but shouldn't an application in the work perimeter use the proxy set on the BES10 automatically?

 

We are currently in the process of getting their IT contractor to analyze the proxy logs, but it would be quite helpful to get the open questions resolved to see what could cause the issues.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Proxy settings in the work perimeter

Using the Qt networking APIs the proxy set on the device should be used automatically. A proxy is only required to be set explicitly in the app when using lower level networking like cURL.

 

What call are you making with the app? And do you set a timeout on the call?

 

I've seen strange issues when making a connection through MDS in the past where the connection never succeeds or fails, but BlackBerry 10 takes a different route so I can't quite say what the problem may be from experience.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Proxy settings in the work perimeter

I use the Qt network API, no low level stuff.

I don't set a timeout, looks like i have to add that manually. Quite a shame...

 

here is the network code i use. NetworkService::manager returns a pointer to the shared QNetworkAccessManager.

 

QNetworkRequest request(url);

currentReply = NetworkService::manager->get(request);
currentReply->ignoreSslErrors(CertificateService::instance()->getExpectedErrors());

connect(CertificateService::instance(), SIGNAL(sslErrors(QString)), this, SLOT(onCertificateServiceError(QString)));
connect(NetworkService::manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authReq(QNetworkReply*,QAuthenticator*)));
connect(currentReply, SIGNAL(sslErrors(const QList<QSslError> &)), CertificateService::instance(), SLOT(onSslErrors(const QList<QSslError> &)));
connect(currentReply, SIGNAL(metaDataChanged()), this, SLOT(metaDataChanged()));
connect(currentReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError)));
connect(currentReply, SIGNAL(finished()), this, SLOT(finished()));

 We try to download a wsdl file to identify/confirm the location of a webservice. Neither the finished nor the error slot is called, the request just stays open until the application is closed. I think the longest we tried was 30min...

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Proxy settings in the work perimeter

Looks like QNAM doesn't have a way to set the timeout....that's unfortunate. I'll send this thread off to Roberto, he has done more work with networking in the enterprise and may have come across this.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Proxy settings in the work perimeter

The timeout is only an annoyance, the real issue is the failing connection.

I can open the exact same url from the work browser, why can't i open it with Qt...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Proxy settings in the work perimeter

Does this work properly in your environment using a similarly self-signed certificate? If so it is likely environmental, something odd/different in the customer's environment cauisng the problem. Analyzing network logs, even your WiFi traffic logs, may give some hints to the cause.

 

If QNetworkAccessManager were reporting back (timing out, erroring etc) then at least we'd have a bit more info to go on.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Proxy settings in the work perimeter

yes, it works properly in our test beds. we have several servers, and one with expired self-signed certificates, which is also working fine.

If i implement the QTimer to cancel the request the logfile will only contain a "request cancelled" line, so i don't know how we could get more information about the issue.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Proxy settings in the work perimeter


simon_hain wrote:

If i implement the QTimer to cancel the request the logfile will only contain a "request cancelled" line, so i don't know how we could get more information about the issue.

Sorry, I meant if QNAM had built-in timeout support.

 

Roberto is investigating, he thinks this may be related to a bug with cURL.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Proxy settings in the work perimeter


gbeukeboom wrote:
Sorry, I meant if QNAM had built-in timeout support.

 

It does not look that way. I found a quite old feature request/bug that had a lot of support, but was never implemented.

Here is the code for a little helper class, didn't test it yet: http://codereview.stackexchange.com/questions/30031/qt-qnetworkreply-network-reply-timeout-helper

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Proxy settings in the work perimeter

Any news here?
We are currently trying to get access to proxy logs, but have not found a solution otherwise.

i'll try to implement manual proxy settings in Qt.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.