utilisation de la constante _DEBUG_AUTORISER (tirée de dd) pour que le curl de la gesénération des pdf ne bloque pas avec les certificats auto-signés
This commit is contained in:
parent
8e8cfc379a
commit
70ef56ad29
2 changed files with 13 additions and 6 deletions
10
README.md
10
README.md
|
@ -194,9 +194,15 @@ $fonction(lire_config('souscriptions/slug_souscription_validation'), $Tdest, $op
|
|||
```
|
||||
|
||||
## Outrepasser l'erreur de certificat auto-signé lors de devs en https local
|
||||
=> dans `inc/cherger_pdf.php` décommenter les 2 lignes suivante:
|
||||
=> dans le mes_options.php du site mettre :
|
||||
```
|
||||
// pour une connexion https locale (certificat auto-signé) décommenter les 2 lignes suivantes
|
||||
define('_DEBUG_AUTORISER', true);
|
||||
```
|
||||
ce qui permet d'activer les options de curl pour ne pas vérifier le certificat dans *charger_pdf.php* :
|
||||
```
|
||||
// pour une connexion https locale avec certificat auto-signé
|
||||
if (defined('_DEBUG_AUTORISER')) {
|
||||
curl_setopt($CurlConnect, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($CurlConnect, CURLOPT_SSL_VERIFYPEER, false);
|
||||
}
|
||||
```
|
||||
|
|
|
@ -19,10 +19,11 @@ function inc_charger_pdf_dist($fichier_pdf, $contexte = []){
|
|||
}
|
||||
$CurlConnect = curl_init();
|
||||
|
||||
// pour une connexion https locale (certificat auto-signé) décommenter les 2 lignes suivantes
|
||||
//curl_setopt($CurlConnect, CURLOPT_SSL_VERIFYHOST, false);
|
||||
//curl_setopt($CurlConnect, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
// pour une connexion https locale avec certificat auto-signé
|
||||
if (defined('_DEBUG_AUTORISER')) {
|
||||
curl_setopt($CurlConnect, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($CurlConnect, CURLOPT_SSL_VERIFYPEER, false);
|
||||
}
|
||||
curl_setopt($CurlConnect, CURLOPT_URL, $url);
|
||||
curl_setopt($CurlConnect, CURLOPT_RETURNTRANSFER, 1 );
|
||||
//curl_setopt($CurlConnect, CURLOPT_POSTFIELDS, $request);
|
||||
|
|
Loading…
Add table
Reference in a new issue