Moodle for mobile

moodle mobile https connection problems

 
Picture of Nagy Nasr
moodle mobile https connection problems
 

Installed moodle 3.2 on Centos Server 

- works on http 

- mobile applications enabled

Installed moodle for mobile latest version

Everything works fine!


Now for security requirements all websites must work only through https
Server ssl and httpd configured for https

Moodle server configured to use https only 

Moodle server works find from browsers  (even from mobile browsers)

Moodle Mobile application can't connect to server, even login screen can't show "Oops! We're having trouble connecting to [server] Double check you've entered the address correctly and try again  <<Try again>> .... For security reasons only https connections are allowed, sorry."

the last info is from the security checks on the network


tried      $CFG->sslproxy = true

leads to login screen shows "Error Can not connect: verify that you have typed the URL and that your site uses Moodle 2.4 or later.   <<OK>>"


Your help/guidance to solve this problem is highly appreciated.









 
Average of ratings: Useful (1)
Picture of Dan Logan
Re: moodle mobile https connection problems
 

Hi

I have just moved my moodle site to https and now my app has stopped working. Any tips would also be appreciated.

Thanks

Dan


 
Average of ratings: Useful (1)
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hello guys,

first of all, make sure your certificate is correctly configured. You can use a SSL Checker to verify that everything is ok.

Also, you need to take into account that Android 4.3 and older don't support TLS 1.2. You should try to open your site in Android's Chrome and check if it is loaded in there.

Kind regards,

Dani

 
Average of ratings: -
Picture of Nagy Nasr
Re: moodle mobile https connection problems
 

Thank you Dani for your reply.

Android is above 5.0
From any browser on the mobile or any other pc/laptop site works fine with https.

It is the moodle mobile application that can't connect the https://[server]

Writing the same Site address as the web bowser https://[server] to the moodle mobile and try to connect <<Connect!>>
The following error message appears:
Oops!
We're having trouble connecting to 
https://[server]

Double check you've entered the address correctly and try again.

<<Try again>>

Still can't connect?

Contact your site administrator for further help.
Please, ask the administrator to check the following issue:
Check that your site uses Moodle 2.4 or later.

 
Average of ratings: -
Picture of Nagy Nasr
Re: moodle mobile https connection problems
 




SSL check seems fine

Any clue?

 
Average of ratings: -
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Nagy,

those warnings in the SSL Checker might be causing problems.

Can you send us your Moodle URL to mobile@moodle.com so we can check it?

Kind regards,

Dani

 
Average of ratings: -
Picture of Nagy Nasr
Re: moodle mobile https connection problems
 

Sure!
What should i write in the subject of the email, so you can recognize the problem?

Regards

 
Average of ratings: -
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Nagy,

thank you for the credentials. It is a problem with the certificate. If I open your site with a desktop browser (Chrome) I get a warning:

Your connection is not private

Attackers might be trying to steal your information from {SITEURL}. NET::ERR_CERT_AUTHORITY_INVALID

You should fix this in order for the app to work.

Kind regards,

Dani

 
Average of ratings: -
Picture of Nagy Nasr
Re: moodle mobile https connection problems
 

Thank you Dani

In summary,

To use https for mobile app, my site should have a purchases certificate from a certificate authority and private certificate won't work! 


Kindly correct me if I'm wrong.



 
Average of ratings: -
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Yes, self signed certificates don't work in the Mobile app.

 
Average of ratings: -
Picture of Nagy Nasr
Re: moodle mobile https connection problems
 
Hi Dani,

The ssl issue has been resolved and now browser sees the site as secured, yet mobile app can't connect or show the login screen and show the previously mentioned error message.

You advice is highly appreciated


 
Average of ratings: -
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hello Nagy,

desktop browsers detect the site as secure, but Android's Chrome still detect it as not private. The reason is that your certificate uses an old cypher. This is the message I get when I check your certificate:

The connection to this site uses a strong protocol (TLS 1.2), an obsolete key exchange (RSA), and an obsolete cipher (AES_256_CBC with HMAC-SHA1).

As you can see, Android is the more restrictive system regarding certificates, it has caused us some headaches sad

Kind regards,

Dani

 
Average of ratings: -
Picture of Dan Logan
Re: moodle mobile https connection problems
 

Hi Dani

Thank you kindly for the response.

I've decided to just rebuild my app as I had hard coded in http://mysite to the address and need to update it to https.

Thanks

Dan


 
Average of ratings: -
Picture of Hermann Klocker-Mark
Re: moodle mobile https connection problems
 

Hello Dani,

my mobiile app on iOS does not work (any more) too and I read this thread to find out why. Checked with SSLChecker, my URL should be ok (Letsencrypt), but I have one idea/question:

Do I have to run my whole moodle through https? At the moment only the login is https, the rest is http.

And if this is not the problem could you give some hints where to start troubleshooting, e.g. look into what logs etc. as the message of the app (as shown above in htis thread) is not helpful at all..

TIA,

Hermann

 
Average of ratings: Useful (1)
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Hermann,

the app uses the "root" URL of your site to check if it uses https or not. If that page doesn't use https, then no requests will use https, they will all use http. All requests to the site use the same protocol.

Please can send us your Moodle URL and a test account to mobile@moodle.com so we can take a look.

Kind regards,

Dani


 
Average of ratings: -
Picture of Hermann Klocker-Mark
Re: moodle mobile https connection problems
 

Hi Dani,

thanks for your quick answer. Just created a user at my site (moodle.klocker-mark.eu) with username mobiletest and your email address. 

I am ready to do any tests or activities.

Hermann

 
Average of ratings: -
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Thanks Hermann,


we opened an issue to fix this, it's an error in the WebService code:


Kind regards,
Dani

 
Average of ratings: -
Picture of Carl Lauer
Re: moodle mobile https connection problems
 

Hi Dani,

You wrote "...Android 4.3 and older don't support TLS 1.2.". Does that mean that there will be problems using the Moodle Mobile App over https on a device whose Android version is 4.3 or older? I could not find any mention elsewhere that when the App runs on Android with a Moodle site secured with a SSL certificate, at least v. 4.4 of Android is required...

A clarification would be much appreciated as we are planning to secure our Moodle site with a SSL certificate and some of our students use older versions of Android.

Carl

 
Average of ratings: -
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Carl,

every brand delivers a customized version of Android so maybe some of them behave different, but in general the devices with Android 4.3 or older shouldn't be able to connect to a site using TLS 1.2. This is because the device cannot determine if the site is secure or not, so they reject the certificate.

However, if you still allow connecting via http, the app should use that connection for the devices that doesn't support the certificate. So what the app will do is:

Try to connect via https.

The device says it's not secure so it rejects the connection.

Try to connect via http.

Please note that some devices with Android 4.4 also have problems to download/upload files if the server uses TLS 1.2. Please see this issue. In this case there is no workaround because the connection to the site is successful, but then the downloads/upload fails.

Kind regards,

Dani

 
Average of ratings: Useful (1)
Picture of Carl Lauer
Re: moodle mobile https connection problems
 

Thank you for the detailed and useful answer, Dani! I'll try to test it later this week, if I get a chance.

Kind regards,

Carl

 
Average of ratings: -
Picture of Usman Kazi
Re: moodle mobile https connection problems
 

Hi everyone 

I was facing similar problem, when we were using http protocol we were using Moodle Mobile App in our mobiles, but when we were install ssl certificate we were unable to logon over Mobile App.

We purchase Godaddy certificate,

Can anyone can help us

Regards 

Usman Kazi 



 
Average of ratings: -
Picture of Dave Perry
Re: moodle mobile https connection problems
Particularly helpful MoodlersTesters

If you bought the ssl via GoDaddy, and host the site with them, they should be able to deploy it for you.

Usually companies like this charge you a fixed annual fee for SSL support - that includes the certificate, and them putting it on your hosting space.

 
Average of ratings: -
Picture of Usman Kazi
Re: moodle mobile https connection problems
 

Thanks Dave for your response.

but my issue is with Moodle Mobile App, site is working fine and ssl certificate test are Ok as well. how i will access moodle on my mobile by usint Moodle Mobile App.

Regards 

Usman Kazi 

 
Average of ratings: -
Picture of Dave Perry
Re: moodle mobile https connection problems
Particularly helpful MoodlersTesters

Do you access the site as https://yoursite.yourdomain.com in a browser on a desktop successfully? If so, use that https:// address in the app - that's all we do

 
Average of ratings: -
Picture of Usman Kazi
Re: moodle mobile https connection problems
 

yes its working fine. 

its https://lms.pac.edu.pk 

but not accessable over mobile app 

 
Average of ratings: -
Picture of Owen Grubbs
Re: moodle mobile https connection problems
 

I can successfully connect to our 3.1 site on my iPhone with the following url string:

https://<moodle.mysite.edu>/moodle



 
Average of ratings: -
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Usman,

I used an SSL checker and it seems you have some problems in your certificate.

Simple check: https://www.sslshopper.com/ssl-checker.html#hostname=lms.pac.edu.pk

Detailed check: https://www.ssllabs.com/ssltest/analyze.html?d=lms.pac.edu.pk

Please try to fix the issues and try again.

Kind regards,

Dani

 
Average of ratings: Useful (1)
Picture of Usman Kazi
Re: moodle mobile https connection problems
 

Great Dani its fixed my Issue

thank you for your support 

 
Average of ratings: -
Picture of Harry Dickinson
Re: moodle mobile https connection problems
 

Having similar problems to others listed in this thread regarding HTTPS and the Moodle Mobile. I have 2 moodle sites (3.3) running on our VPS with SSL certificate. One site is used as our test bed and the other is our production site, both using https.

The test bed site works perfectly with Moodle Mobile but the production site will not connect and produces the same error messages as Nagy Nasr was getting. The SSL cert seems to check out fine. The major difference between the sites is that the production site uses SSO in the form of OpenID Connect. 

Test bed:  https://lms.ichas.net

Production:  https://students.ichas.net

Would really like to have Moodle Mobile available for the students so am hoping somebody running SSO has had similar problems and found a solution. 

Pulling out hair at the moment so any assistance very much appreciated. 


Harry

 
Average of ratings: -
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Harry,

your problem is not related with the certificate, it's a bug in Moodle 3.3.

One of the problems that can cause this error was fixed in Moodle 3.3.2, so please try updating your site to that version. If you're already on that version or it doesn't fix the problem, please try applying the patch in this issue to your site:

https://tracker.moodle.org/browse/MDL-60132

This issue will be fixed in Moodle 3.3.3.

Kind regards,

Dani

 
Average of ratings: -
Picture of Harry Dickinson
Re: moodle mobile https connection problems
 

Many thanks for the info update Dani. Will try your suggestion.

Great to see so much work going on with Moodle. Have been using it for a lot of years but it is now really looking polished and powerful. Students love the SSO and how it now integrates almost seamlessly with Office 365.

Keep up the great work.

Harry

 
Average of ratings: -
Picture of Mei Ling
Re: moodle mobile https connection problems
 

Hi, we have customized the Moodle APP for our university. Most of the students can access the Custom Moodle APP, however there are few of them can't.


The got error :  Check that your site uses Moodle 2.4 or later


They used Android 4.4.2. Is the android version too old cause this problem?

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: moodle mobile https connection problems
Core developersParticularly helpful MoodlersPlugin developers

Hi Mei,
the operating system of the client is pretty old: you should check how you've configured the web server about your server certificate, guessing that you're not properly expose the root CA certificates chain i.e. the older client fails in validating your valid server certificate since it misses updates about recent root CAs.

Ref.: https://docs.moodle.org/dev/Moodle_Mobile_FAQ#Everything_seems_to_be_correctly_configured_but_I_see_this_error:_Cannot_connect:_Verify_that_your_have_typed_correctly_the_URL_and_that_your_site_uses_Moodle_2.4_or_later

HTH,
Matteo

 
Average of ratings: -
Picture of Christian Herwig
Re: moodle mobile https connection problems
 

Hi,

our moodle-site (3.4.3) is https://moodle.esfl.de with Lets encrypt certificate (made in september).

It works on all tested Browsers and is labelled secure on these browsers.

A Test with sslchecker shows no problems, a test with ssllabs shows almost 100% compliance, the only issue is wrong order of intermediate certificates and no dns caa but as i understand it, that should be minor problems.

The Mobile App (newest version) refuses to connect (no connection possible) but the
connection to moodle.org from the mobile app works correcty.
A browser connection from Android 6 to https://moodle.esfl.de works without problems.

What is wrong? I can only guess a firewall issue or a bug in the mobile app.

Please help us,

 
Average of ratings: -
Picture of Christian Herwig
Re: moodle mobile https connection problems
 

Update: The moodle Webservice activation in Administration says
Certificate Chain seems to be invalid.

But only Moodle thinks it is so. SSLChecker does not. Maybe the bug is not in the mobile app but in moodle itself or in the server setup!?

 
Average of ratings: -
Picture of Christian Herwig
Re: moodle mobile https connection problems
 
I now solved the problem with the certifcate chain, moodle service shows no problem indication anymore. But the original problem stays. Mobile Moodle (current Version) is not able to connect. Answer is still: "http failure response(unknown url)" :0 Unknown Error
 
Average of ratings: -
Picture of Dani Palou
Re: moodle mobile https connection problems
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Christian,

the server is returning this error:

{"error":"Ungültige URL oder ungültiger Port","stacktrace":null,"debuginfo":null,"errorcode":"requirecorrectaccess"}

You can see it with this URL:

https://moodle.esfl.de/login/token.php

Please fix this error and try again.

Kind regards,

Dani

 
Average of ratings: -
Picture of Christian Herwig
Re: moodle mobile https connection problems
 
Yippiee! Your hint put me in the right direction. Fixed it with a new hosts entry and new wwwroot entry in config.php. That was great help ! Thank you, Dani.
 
Average of ratings: -