mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-52766 mnet: Support MNet peer URLs longer than 64 characters
The commonName in SSL certificate is limited to 64 characters as per RFC 5280 (https://www.ietf.org/rfc/rfc5280.txt). We respect that limit when generating the CN attribute from the site's $CFG->wwwroot. But then we did not respect it when comparing the common name with the peer's URL so the certificate was not considered valid.
This commit is contained in:
parent
9d5d9c64ff
commit
511f8c46b7
@ -170,7 +170,7 @@ class mnet_peer {
|
||||
$a['host'] = $this->wwwroot;
|
||||
$this->error[] = array('code' => 5, 'text' => get_string("nonmatchingcert", 'mnet', $a));
|
||||
return false;
|
||||
} elseif ($credentials['subject']['CN'] != $this->wwwroot) {
|
||||
} else if ($credentials['subject']['CN'] !== substr($this->wwwroot, 0, 64)) {
|
||||
$a['subject'] = $credentials['subject']['CN'];
|
||||
$a['host'] = $this->wwwroot;
|
||||
$this->error[] = array('code' => 4, 'text' => get_string("nonmatchingcert", 'mnet', $a));
|
||||
|
Loading…
x
Reference in New Issue
Block a user