Issue Details (XML | Word | Printable)

Key: MDL-14624
Type: Improvement Improvement
Status: Reopened Reopened
Priority: Major Major
Assignee: Howard Miller
Reporter: Howard Miller
Votes: 0
Watchers: 5
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

mnet can't setup a peer when a proxy is in use.

Created: 30/Apr/08 10:23 PM   Updated: 03/Jun/08 05:38 PM
Return to search
Component/s: Networking
Affects Version/s: 1.9, 2.0
Fix Version/s: 2.0

Issue Links:
Blockers
 

Participants: Dan Poltawski, Howard Miller and Petr Skoda
Security Level: None
Resolved date: 12/May/08
Affected Branches: MOODLE_19_STABLE, MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
The mnet code doesn't contain any checks for proxies. This is actually fairly easy to fix, as using curl through a proxy is used and (proven) in other places. It only requires the routine that scrapes the site title to use download_file_content() - which just works - and to modify the curl call that gets the SSO key to check for proxies - mainly by taking the code from the former function.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Howard Miller added a comment - 30/Apr/08 10:39 PM
Should now be able to establish link with peer through a HTTP proxy. Mostly uses existing (hence tested hopefully) functions and code snippets.

Howard Miller made changes - 30/Apr/08 10:39 PM
Field Original Value New Value
Fix Version/s 2.0 [ 10122 ]
Resolution Fixed [ 1 ]
Fix Version/s 1.9.1 [ 10240 ]
Status Open [ 1 ] Resolved [ 5 ]
Dan Poltawski added a comment - 01/May/08 12:27 AM
Hi Howard,

I am just wondering if this works?

My vague memory was that thought that the mnet handshaking would check that the incoming request comes from the same ip address as dns resolves the host to. So using a proxy would cause that check to fail? (But also, if you are using a proxy and can't get out directly, how does the mnet peer verify who you are and chat back to you?)


Howard Miller added a comment - 01/May/08 06:09 AM
A very good point that I had not considered. However, it works perfectly from behind my Squid firewall. I can now connect to either Moodle or Mahara and I couldn't before. I'll have a bit more of think about it, and see if I can justify why it works though

Howard Miller added a comment - 01/May/08 05:30 PM
Just checking - both Moodle sites report the IP address of the peer machine as it's actual IP address. The presence of the proxy doesn't seem to make any difference. I haven't checked the exact operation, but I guess that if the xmlrpc packet simply contains the originating host name then the IP still resolves correctly and it all works. As long as the path to "get back" is established (proxy or no) then you have a connection. I suppose this means that it doesn't check what the IP was that the request came from!

Petr Skoda added a comment - 05/May/08 03:02 PM
Please consider reverting this in MOODLE_19_STABLE - see MDL-14659

Petr Skoda made changes - 05/May/08 03:02 PM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Howard Miller added a comment - 05/May/08 03:17 PM
This fix could cause problems, without resolving MDL-14659 so that proxies can be excluded for (typically) local addresses.

Howard Miller made changes - 05/May/08 03:17 PM
Link This issue is blocked by MDL-14659 [ MDL-14659 ]
thepurpleblob committed 2 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 05/May/08 04:19 PM
MDL-14624:
Reverting fix. This needs proxy to have exceptions for local subnets available.
Will work on this in HEAD only
MODIFY mnet/lib.php   Rev. 1.16.2.4    (+1 -30 lines)
MODIFY mnet/peer.php   Rev. 1.9.2.2    (+2 -2 lines)
Howard Miller added a comment - 05/May/08 04:20 PM
Changes reverted in 1.9. Will leave in HEAD and continue to resolve MDL-14659.

Howard Miller added a comment - 12/May/08 04:43 PM
Fixed in HEAD only. MNET now uses Proxy settings if specified, but you can bypass it for specified domains if you so wish.

Howard Miller made changes - 12/May/08 04:43 PM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]
Fix Version/s 1.9.1 [ 10240 ]
Howard Miller added a comment - 03/Jun/08 05:38 PM
Doesn't consider mnet/xmlrpc/client.php and server.php. This worked for me without. I wonder why.

This really needs that curl code to be put in the library, as the proxy code will be duplicated again and again.


Howard Miller made changes - 03/Jun/08 05:38 PM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]