Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 442... Línea 442...
442
    }
442
    }
443
    unset($csr_rsc); // Free up the resource
443
    unset($csr_rsc); // Free up the resource
Línea 444... Línea 444...
444
 
444
 
445
    // We export our self-signed certificate to a string.
445
    // We export our self-signed certificate to a string.
446
    openssl_x509_export($selfSignedCert, $keypair['certificate']);
-
 
447
    // TODO: Remove this block once PHP 8.0 becomes required.
-
 
448
    if (PHP_MAJOR_VERSION < 8) {
-
 
449
        openssl_x509_free($selfSignedCert);
-
 
Línea 450... Línea 446...
450
    }
446
    openssl_x509_export($selfSignedCert, $keypair['certificate']);
451
 
447
 
452
    // Export your public/private key pair as a PEM encoded string. You
448
    // Export your public/private key pair as a PEM encoded string. You
453
    // can protect it with an optional passphrase if you wish.
449
    // can protect it with an optional passphrase if you wish.
454
    if (!empty($CFG->opensslcnf)) { //allow specification of openssl.cnf especially for Windows installs
450
    if (!empty($CFG->opensslcnf)) { //allow specification of openssl.cnf especially for Windows installs
455
        $export = openssl_pkey_export($new_key, $keypair['keypair_PEM'], null, array("config" => $CFG->opensslcnf));
451
        $export = openssl_pkey_export($new_key, $keypair['keypair_PEM'], null, array("config" => $CFG->opensslcnf));
456
    } else {
452
    } else {
457
        $export = openssl_pkey_export($new_key, $keypair['keypair_PEM'] /* , $passphrase */);
-
 
458
    }
-
 
459
    // TODO: Remove this block once PHP 8.0 becomes required.
-
 
460
    if (PHP_MAJOR_VERSION < 8) {
-
 
461
        openssl_pkey_free($new_key);
453
        $export = openssl_pkey_export($new_key, $keypair['keypair_PEM'] /* , $passphrase */);
Línea 462... Línea 454...
462
    }
454
    }
463
    unset($new_key); // Free up the resource
455
    unset($new_key); // Free up the resource